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

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

Issue 2832403002: merge PrecedenceInfo into TokenType and update all refs (Closed)
Patch Set: rebase Created 3 years, 8 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/lib/src/dart/scanner/scanner.dart ('k') | pkg/analyzer/lib/src/fasta/token_utils.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 37cb7b1beb34876058f25a0f8df8f42006c3961d..a49b372d46c16ff4ff500f0306f104a228272a36 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -12,7 +12,6 @@ import 'package:analyzer/dart/ast/token.dart' show TokenType;
import 'package:analyzer/dart/element/element.dart' show Element;
import 'package:front_end/src/fasta/parser/parser.dart'
show FormalParameterType, Parser;
-import 'package:front_end/src/fasta/scanner/precedence.dart';
import 'package:front_end/src/fasta/scanner/string_scanner.dart';
import 'package:front_end/src/fasta/scanner/token.dart'
show BeginGroupToken, CommentToken, Token;
@@ -1917,12 +1916,13 @@ class AstBuilder extends ScopeListener {
Token injectGenericCommentTypeAssign(Token token) {
// TODO(paulberry,scheglov,ahe): figure out how to share these generic
// comment methods with BodyBuilder.
- return _injectGenericComment(token, GENERIC_METHOD_TYPE_ASSIGN, 3);
+ return _injectGenericComment(
+ token, TokenType.GENERIC_METHOD_TYPE_ASSIGN, 3);
}
@override
Token injectGenericCommentTypeList(Token token) {
- return _injectGenericComment(token, GENERIC_METHOD_TYPE_LIST, 2);
+ return _injectGenericComment(token, TokenType.GENERIC_METHOD_TYPE_LIST, 2);
}
@override
@@ -1939,9 +1939,9 @@ class AstBuilder extends ScopeListener {
}
/// Check if the given [token] has a comment token with the given [info],
- /// which should be either [GENERIC_METHOD_TYPE_ASSIGN] or
- /// [GENERIC_METHOD_TYPE_LIST]. If found, parse the comment into tokens and
- /// inject into the token stream before the [token].
+ /// which should be either [TokenType.GENERIC_METHOD_TYPE_ASSIGN] or
+ /// [TokenType.GENERIC_METHOD_TYPE_LIST]. If found, parse the comment
+ /// into tokens and inject into the token stream before the [token].
Token _injectGenericComment(Token token, TokenType info, int prefixLen) {
if (parseGenericMethodComments) {
CommentToken t = token.precedingCommentTokens;
@@ -1965,7 +1965,7 @@ class AstBuilder extends ScopeListener {
void _injectTokenList(Token beforeToken, Token firstToken) {
// Scanner creates a cyclic EOF token.
Token lastToken = firstToken;
- while (lastToken.next.info != EOF_INFO) {
+ while (lastToken.next.info != TokenType.EOF) {
lastToken = lastToken.next;
}
// Inject these new tokens into the stream.
« no previous file with comments | « pkg/analyzer/lib/src/dart/scanner/scanner.dart ('k') | pkg/analyzer/lib/src/fasta/token_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698