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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart

Issue 2708703002: Capture const/final/var keyword in AstBuilder.endTopLevelFields. (Closed)
Patch Set: Created 3 years, 10 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/analyzer/test/generated/parser_test.dart ('k') | no next file » | 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 f275201ab3346cb10dd4a3850e0216a67e085d2d..b75cb180b3dd0acf1d9e30a0ea62442686a76683 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -63,10 +63,10 @@ class AstBuilder extends ScopeListener {
/// to the list.
var accumulateIdentifierComponents = false;
-
AstBuilder(this.library, this.member, this.elementStore, Scope scope,
[Uri uri])
- : uri = uri ?? library.fileUri, super(scope);
+ : uri = uri ?? library.fileUri,
+ super(scope);
createJumpTarget(JumpTargetKind kind, int charOffset) {
// TODO(ahe): Implement jump targets.
@@ -980,9 +980,12 @@ class AstBuilder extends ScopeListener {
debugEvent("TopLevelFields");
List<VariableDeclaration> variables = popList(count);
TypeAnnotation type = pop();
- // TODO(paulberry): the var/const/final keyword should be pointed to by
- // beginToken.
- var keyword = null; // TODO(paulberry)
+ var keyword;
+ if (optional('var', beginToken) ||
+ optional('const', beginToken) ||
+ optional('final', beginToken)) {
+ keyword = beginToken;
+ }
var variableList = ast.variableDeclarationList(
null, null, toAnalyzerToken(keyword), type, variables);
var modifiers = pop();
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698