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

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

Issue 2776733002: Include CompilationUnit begin/endToken(s) with Fasta. (Closed)
Patch Set: Verify begin/endToken(s) of CompilationUnit. 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 | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/fasta/ast_builder.dart
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 7c9d2ceb5c8265da56611974132c78ce3dec7b3d..52b28218a321dc34abf9d44aaf8fc43e7a052910 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1054,14 +1054,19 @@ class AstBuilder extends ScopeListener {
}
@override
- void endCompilationUnit(int count, Token token) {
+ void beginCompilationUnit(Token token) {
+ push(token);
+ }
+
+ @override
+ void endCompilationUnit(int count, Token endToken) {
debugEvent("CompilationUnit");
- analyzer.Token beginToken = null; // TODO(paulberry)
+ List<Object> elements = popList(count);
+ Token beginToken = pop();
+
ScriptTag scriptTag = null;
var directives = <Directive>[];
var declarations = <CompilationUnitMember>[];
- analyzer.Token endToken = null; // TODO(paulberry)
- List<Object> elements = popList(count);
if (elements != null) {
for (AstNode node in elements) {
if (node is ScriptTag) {
@@ -1076,6 +1081,7 @@ class AstBuilder extends ScopeListener {
}
}
}
+
push(ast.compilationUnit(
beginToken, scriptTag, directives, declarations, endToken));
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698