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

Unified Diff: pkg/front_end/lib/src/fasta/parser/parser.dart

Issue 2890523002: merge fasta.Token into 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/front_end/lib/src/fasta/parser/parser.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index 0b1e47a0141fb88f4e511504997dbbe29410c864..c6f7697bce1a211fa8903506944fb1d8da1ae81d 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -54,7 +54,7 @@ import '../fasta_codes.dart'
codeYieldAsIdentifier,
codeYieldNotGenerator;
-import '../scanner.dart' show ErrorToken;
+import '../scanner.dart' show ErrorToken, Token;
import '../scanner/recover.dart' show closeBraceFor, skipToEof;
@@ -63,18 +63,12 @@ import '../../scanner/token.dart'
ASSIGNMENT_PRECEDENCE,
CASCADE_PRECEDENCE,
EQUALITY_PRECEDENCE,
- Keyword,
POSTFIX_PRECEDENCE,
RELATIONAL_PRECEDENCE,
TokenType;
import '../scanner/token.dart'
- show
- BeginGroupToken,
- KeywordToken,
- SymbolToken,
- Token,
- isUserDefinableOperator;
+ show BeginGroupToken, SymbolToken, isUserDefinableOperator;
import '../scanner/token_constants.dart'
show
@@ -805,9 +799,8 @@ class Parser {
final kind = token.kind;
if (identical(kind, IDENTIFIER_TOKEN)) return true;
if (identical(kind, KEYWORD_TOKEN)) {
- Keyword keyword = (token as KeywordToken).keyword;
- String value = keyword.lexeme;
- return keyword.isPseudo ||
+ String value = token.type.lexeme;
+ return token.type.isPseudo ||
(identical(value, 'dynamic')) ||
(identical(value, 'void'));
}
@@ -1043,8 +1036,7 @@ class Parser {
token =
reportUnrecoverableErrorCodeWithToken(token, codeExpectedIdentifier)
.next;
- } else if (token.isBuiltInIdentifier &&
- !context.isBuiltInIdentifierAllowed) {
+ } else if (token.type.isBuiltIn && !context.isBuiltInIdentifierAllowed) {
if (context.inDeclaration) {
reportRecoverableErrorCodeWithToken(
token, codeBuiltInIdentifierInDeclaration);
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | pkg/front_end/lib/src/fasta/parser/parser_main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698