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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/recover.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/precedence.dart ('k') | pkg/front_end/lib/src/fasta/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/recover.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/recover.dart b/pkg/front_end/lib/src/fasta/scanner/recover.dart
index edf7073e30b1285e8e6927d9da1e4bab15e55ed5..aed2d7444b2aee077321b2936c6cd1bdab2fdb5b 100644
--- a/pkg/front_end/lib/src/fasta/scanner/recover.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/recover.dart
@@ -24,8 +24,6 @@ import 'token.dart' show StringToken, SymbolToken, Token;
import 'error_token.dart' show NonAsciiIdentifierToken, ErrorToken;
-import 'precedence.dart' as Precedence;
-
/// Recover from errors in [tokens]. The original sources are provided as
/// [bytes]. [lineStarts] are the beginning character offsets of lines, and
/// must be updated if recovery is performed rewriting the original source
@@ -86,13 +84,13 @@ Token defaultRecoveryStrategy(
// [errorTail] ends. This is the case for "b" above.
bool append = false;
if (goodTail != null) {
- if (goodTail.info == Precedence.IDENTIFIER_INFO &&
+ if (goodTail.info == TokenType.IDENTIFIER &&
goodTail.charEnd == first.charOffset) {
prepend = true;
}
}
Token next = errorTail.next;
- if (next.info == Precedence.IDENTIFIER_INFO &&
+ if (next.info == TokenType.IDENTIFIER &&
errorTail.charOffset + 1 == next.charOffset) {
append = true;
}
@@ -123,12 +121,12 @@ Token defaultRecoveryStrategy(
next = next.next;
}
String value = new String.fromCharCodes(codeUnits);
- return synthesizeToken(charOffset, value, Precedence.IDENTIFIER_INFO)
+ return synthesizeToken(charOffset, value, TokenType.IDENTIFIER)
..next = next;
}
recoverExponent() {
- return synthesizeToken(errorTail.charOffset, "NaN", Precedence.DOUBLE_INFO)
+ return synthesizeToken(errorTail.charOffset, "NaN", TokenType.DOUBLE)
..next = errorTail.next;
}
@@ -138,7 +136,7 @@ Token defaultRecoveryStrategy(
}
recoverHexDigit() {
- return synthesizeToken(errorTail.charOffset, "-1", Precedence.INT_INFO)
+ return synthesizeToken(errorTail.charOffset, "-1", TokenType.INT)
..next = errorTail.next;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('k') | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698