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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/ast_builder.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
« no previous file with comments | « pkg/compiler/tool/perf.dart ('k') | pkg/front_end/lib/src/fasta/analyzer/token_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
index cc0f2303c817423d35c5e0d7b403930ddeb5f27c..6c9a446bf3751d84bdd71e0019e723838af37566 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -109,28 +109,28 @@ class AstBuilder extends ScopeListener {
}
void doStringPart(Token token) {
- push(ast.simpleStringLiteral(toAnalyzerToken(token), token.value));
+ push(ast.simpleStringLiteral(toAnalyzerToken(token), token.lexeme));
}
void endLiteralString(int interpolationCount, Token endToken) {
debugEvent("endLiteralString");
if (interpolationCount == 0) {
Token token = pop();
- String value = unescapeString(token.value);
+ String value = unescapeString(token.lexeme);
push(ast.simpleStringLiteral(toAnalyzerToken(token), value));
} else {
List parts = popList(1 + interpolationCount * 2);
Token first = parts.first;
Token last = parts.last;
- Quote quote = analyzeQuote(first.value);
+ Quote quote = analyzeQuote(first.lexeme);
List<InterpolationElement> elements = <InterpolationElement>[];
- elements.add(ast.interpolationString(
- toAnalyzerToken(first), unescapeFirstStringPart(first.value, quote)));
+ elements.add(ast.interpolationString(toAnalyzerToken(first),
+ unescapeFirstStringPart(first.lexeme, quote)));
for (int i = 1; i < parts.length - 1; i++) {
var part = parts[i];
if (part is Token) {
elements
- .add(ast.interpolationString(toAnalyzerToken(part), part.value));
+ .add(ast.interpolationString(toAnalyzerToken(part), part.lexeme));
} else if (part is Expression) {
elements.add(ast.interpolationExpression(null, part, null));
} else {
@@ -139,7 +139,7 @@ class AstBuilder extends ScopeListener {
}
}
elements.add(ast.interpolationString(
- toAnalyzerToken(last), unescapeLastStringPart(last.value, quote)));
+ toAnalyzerToken(last), unescapeLastStringPart(last.lexeme, quote)));
push(ast.stringInterpolation(elements));
}
}
@@ -186,7 +186,7 @@ class AstBuilder extends ScopeListener {
push(ast.enumConstantDeclaration(comment, metadata, identifier));
} else {
if (context.isScopeReference) {
- String name = token.value;
+ String name = token.lexeme;
Builder builder = scope.lookup(name, token.charOffset, uri);
if (builder != null) {
Element element = elementStore[builder];
@@ -332,7 +332,7 @@ class AstBuilder extends ScopeListener {
void handleLiteralInt(Token token) {
debugEvent("LiteralInt");
- push(ast.integerLiteral(toAnalyzerToken(token), int.parse(token.value)));
+ push(ast.integerLiteral(toAnalyzerToken(token), int.parse(token.lexeme)));
}
void endExpressionFunctionBody(Token arrowToken, Token endToken) {
@@ -494,7 +494,7 @@ class AstBuilder extends ScopeListener {
void handleLiteralDouble(Token token) {
debugEvent("LiteralDouble");
- push(ast.doubleLiteral(toAnalyzerToken(token), double.parse(token.value)));
+ push(ast.doubleLiteral(toAnalyzerToken(token), double.parse(token.lexeme)));
}
void handleLiteralNull(Token token) {
@@ -1502,7 +1502,7 @@ class _Modifiers {
// disallowed modifiers are not used; the parser should do that.
// TODO(paulberry,ahe): implement the necessary logic in the parser.
for (var token in modifierTokens) {
- var s = token.value;
+ var s = token.lexeme;
if (identical('abstract', s)) {
abstractKeyword = token;
} else if (identical('const', s)) {
« no previous file with comments | « pkg/compiler/tool/perf.dart ('k') | pkg/front_end/lib/src/fasta/analyzer/token_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698