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

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

Issue 2872433005: more work aligning fasta.Token with analyzer.Token (Closed)
Patch Set: Created 3 years, 7 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/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 8f4fd139d1cc4ac54f3fa8034a90689a4e59f5dc..8a90d7cce9c30ebb6d53ac8236930ffe89d8d6a6 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -15,6 +15,7 @@ import 'package:front_end/src/fasta/parser/parser.dart'
import 'package:front_end/src/fasta/scanner/string_scanner.dart';
import 'package:front_end/src/fasta/scanner/token.dart'
show BeginGroupToken, CommentToken, Token;
+import 'package:front_end/src/scanner/token.dart' as analyzer;
import 'package:front_end/src/fasta/errors.dart' show internalError;
import 'package:front_end/src/fasta/fasta_codes.dart'
@@ -212,7 +213,7 @@ class AstBuilder extends ScopeListener {
// TODO(paulberry): analyzer's ASTs allow for enumerated values to have
// metadata, but the spec doesn't permit it.
List<Annotation> metadata;
- Comment comment = _toAnalyzerComment(token.precedingCommentTokens);
+ Comment comment = _toAnalyzerComment(token.precedingComments);
push(ast.enumConstantDeclaration(comment, metadata, identifier));
} else {
if (context.isScopeReference) {
@@ -1863,7 +1864,7 @@ class AstBuilder extends ScopeListener {
void beginMetadataStar(Token token) {
debugEvent("beginMetadataStar");
if (token.precedingComments != null) {
- push(_toAnalyzerComment(token.precedingCommentTokens));
+ push(_toAnalyzerComment(token.precedingComments));
} else {
push(NullValue.Comments);
}
@@ -1894,7 +1895,7 @@ class AstBuilder extends ScopeListener {
}
}
- Comment _toAnalyzerComment(Token comments) {
+ Comment _toAnalyzerComment(analyzer.Token comments) {
if (comments == null) return null;
// This is temporary placeholder code to get tests to pass.
@@ -1949,7 +1950,7 @@ class AstBuilder extends ScopeListener {
/// into tokens and inject into the token stream before the [token].
Token _injectGenericComment(Token token, TokenType type, int prefixLen) {
if (parseGenericMethodComments) {
- CommentToken t = token.precedingCommentTokens;
+ CommentToken t = token.precedingComments;
for (; t != null; t = t.next) {
if (t.type == type) {
String code = t.lexeme.substring(prefixLen, t.lexeme.length - 2);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/fasta/token_utils.dart » ('j') | pkg/front_end/lib/src/fasta/parser/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698