Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Unified Diff: pkg/front_end/lib/src/fasta/scanner/token.dart

Issue 2738313002: rename fasta.Token.value --> lexeme (Closed)
Patch Set: merge Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/scanner/token.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index 43eed184995fa4a18c97672fad43a7488df9304e..6cacd012d2b5b5260dfdc555b6dcdb902a9094c9 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -56,9 +56,9 @@ abstract class Token {
/**
* The string represented by this token, a substring of the source code.
*
- * For [StringToken]s the [value] includes the quotes, explicit escapes, etc.
+ * For [StringToken]s the [lexeme] includes the quotes, explicit escapes, etc.
*/
- String get value;
+ String get lexeme;
/**
* For symbol and keyword tokens, returns the string value represented by this
@@ -70,7 +70,7 @@ abstract class Token {
* [:identical('class', token.value):].
*
* Note that returning [:null:] for string tokens is important to identify
- * symbols and keywords, we cannot use [value] instead. The string literal
+ * symbols and keywords, we cannot use [lexeme] instead. The string literal
* "$a($b"
* produces ..., SymbolToken($), StringToken(a), StringToken((), ...
*
@@ -102,7 +102,7 @@ abstract class Token {
* structure of the token, for example 'StringToken(foo)' for the identifier
* token 'foo'.
*
- * Use [value] for the text actually parsed by the token.
+ * Use [lexeme] for the text actually parsed by the token.
*/
String toString();
@@ -115,7 +115,7 @@ abstract class Token {
// instead of the size of the length of the error message.
return 1;
} else {
- return value.length;
+ return lexeme.length;
}
}
@@ -134,13 +134,13 @@ class SymbolToken extends Token {
SymbolToken(this.info, int charOffset) : super(charOffset);
- String get value => info.value;
+ String get lexeme => info.value;
String get stringValue => info.value;
bool isIdentifier() => false;
- String toString() => "SymbolToken($value)";
+ String toString() => "SymbolToken($lexeme)";
bool get isEof => info == EOF_INFO;
}
@@ -168,13 +168,13 @@ class KeywordToken extends Token {
PrecedenceInfo get info => keyword.info;
- String get value => keyword.syntax;
+ String get lexeme => keyword.syntax;
String get stringValue => keyword.syntax;
bool isIdentifier() => keyword.isPseudo || keyword.isBuiltIn;
- String toString() => "KeywordToken($value)";
+ String toString() => "KeywordToken($lexeme)";
}
/**
@@ -240,7 +240,7 @@ class StringToken extends Token {
}
}
- String get value {
+ String get lexeme {
if (valueOrLazySubstring is String) {
return valueOrLazySubstring;
} else {
@@ -264,7 +264,7 @@ class StringToken extends Token {
bool isIdentifier() => identical(kind, IDENTIFIER_TOKEN);
- String toString() => "StringToken($value)";
+ String toString() => "StringToken($lexeme)";
static final StringCanonicalizer canonicalizer = new StringCanonicalizer();
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/recover.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698