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

Unified Diff: pkg/dart_parser/lib/src/parser.dart

Issue 2650803002: Rename events. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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/dart_parser/lib/src/listener.dart ('k') | pkg/fasta/lib/src/analyzer/ast_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dart_parser/lib/src/parser.dart
diff --git a/pkg/dart_parser/lib/src/parser.dart b/pkg/dart_parser/lib/src/parser.dart
index 38f63376eda8ec5f3a4395f49b9d200c21dcd052..13e8d410ced9c00e88afaaaa81d24492b57f0c57 100644
--- a/pkg/dart_parser/lib/src/parser.dart
+++ b/pkg/dart_parser/lib/src/parser.dart
@@ -467,12 +467,12 @@ class Parser {
listener.beginFunctionTypedFormalParameter(token);
listener.handleNoTypeVariables(token);
token = parseFormalParameters(token);
- listener.handleFunctionTypedFormalParameter(token);
+ listener.endFunctionTypedFormalParameter(token);
} else if (optional('<', token)) {
listener.beginFunctionTypedFormalParameter(token);
token = parseTypeVariablesOpt(token);
token = parseFormalParameters(token);
- listener.handleFunctionTypedFormalParameter(token);
+ listener.endFunctionTypedFormalParameter(token);
}
String value = token.stringValue;
if ((identical('=', value)) || (identical(':', value))) {
@@ -1067,10 +1067,10 @@ class Parser {
Token token = parseIdentifier(name);
int fieldCount = 1;
- token = parseVariableInitializerOpt(token);
+ token = parseFieldInitializerOpt(token);
while (optional(',', token)) {
token = parseIdentifier(token.next);
- token = parseVariableInitializerOpt(token);
+ token = parseFieldInitializerOpt(token);
++fieldCount;
}
Token semicolon = token;
@@ -1211,14 +1211,22 @@ class Parser {
return const Link<Token>();
}
+ Token parseFieldInitializerOpt(Token token) {
+ if (optional('=', token)) {
+ Token assignment = token;
+ listener.beginFieldInitializer(token);
+ token = parseExpression(token.next);
+ listener.endFieldInitializer(assignment);
+ }
+ return token;
+ }
+
Token parseVariableInitializerOpt(Token token) {
if (optional('=', token)) {
Token assignment = token;
- // TODO(ahe): Rename this to beginVariableInitializer.
- listener.beginInitializer(token);
+ listener.beginVariableInitializer(token);
token = parseExpression(token.next);
- // TODO(ahe): Rename this to endVariableInitializer.
- listener.endInitializer(assignment);
+ listener.endVariableInitializer(assignment);
}
return token;
}
@@ -1241,9 +1249,9 @@ class Parser {
mayParseFunctionExpressions = false;
do {
token = token.next;
- listener.beginConstructorInitializer(token);
+ listener.beginInitializer(token);
token = parseExpression(token);
- listener.endConstructorInitializer(token);
+ listener.endInitializer(token);
++count;
} while (optional(',', token));
mayParseFunctionExpressions = old;
@@ -1730,7 +1738,7 @@ class Parser {
} else {
token = skipBlock(token);
}
- listener.skippedFunctionBody(token);
+ listener.handleFunctionBodySkipped(token);
}
return token;
}
« no previous file with comments | « pkg/dart_parser/lib/src/listener.dart ('k') | pkg/fasta/lib/src/analyzer/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698