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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/token.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/front_end/lib/src/fasta/scanner/recover.dart ('k') | pkg/front_end/lib/src/scanner/token.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/token.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index a3e91fa9126044ce5f53578a6f33148b0f8e9b19..e88d71319f1bfddc48e72d6b381fe0271c22ed16 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -7,9 +7,6 @@ library fasta.scanner.token;
import '../../scanner/token.dart' as analyzer;
import '../../scanner/token.dart' show TokenType;
-import 'precedence.dart'
- show AS_INFO, BAD_INPUT_INFO, EOF_INFO, IS_INFO, KEYWORD_INFO;
-
import 'token_constants.dart' show IDENTIFIER_TOKEN;
import 'string_canonicalizer.dart';
@@ -122,7 +119,7 @@ abstract class Token implements analyzer.TokenWithComment {
* The number of characters parsed by this token.
*/
int get charCount {
- if (info == BAD_INPUT_INFO) {
+ if (info == analyzer.TokenType.BAD_INPUT) {
// This is a token that wraps around an error message. Return 1
// instead of the size of the length of the error message.
return 1;
@@ -147,7 +144,9 @@ abstract class Token implements analyzer.TokenWithComment {
@override
analyzer.TokenType get type {
// Analyzer has a different concept of what is a Keyword type.
- return info == AS_INFO || info == IS_INFO ? KEYWORD_INFO : info;
+ return info == TokenType.AS || info == TokenType.IS
+ ? TokenType.KEYWORD
+ : info;
}
@override
@@ -249,7 +248,7 @@ class SymbolToken extends Token {
SymbolToken(this.info, int charOffset) : super(charOffset);
factory SymbolToken.eof(int charOffset) {
- var eof = new SyntheticSymbolToken(EOF_INFO, charOffset);
+ var eof = new SyntheticSymbolToken(analyzer.TokenType.EOF, charOffset);
// EOF points to itself so there's always infinite look-ahead.
eof.previousToken = eof;
eof.next = eof;
@@ -269,7 +268,7 @@ class SymbolToken extends Token {
String toString() => "SymbolToken(${isEof ? '-eof-' : lexeme})";
@override
- bool get isEof => info == EOF_INFO;
+ bool get isEof => info == analyzer.TokenType.EOF;
@override
Token copyWithoutComments() => isEof
@@ -352,7 +351,7 @@ class KeywordToken extends Token implements analyzer.KeywordTokenWithComment {
analyzer.Keyword value() => keyword;
@override
- analyzer.TokenType get type => KEYWORD_INFO;
+ analyzer.TokenType get type => TokenType.KEYWORD;
}
/**
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/recover.dart ('k') | pkg/front_end/lib/src/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698