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

Unified Diff: pkg/front_end/lib/src/scanner/token.dart

Issue 2755433004: align fasta.PrecedenceInfo.precedence with analyzer.TokenType.precedence (Closed)
Patch Set: fix tilde precedence test Created 3 years, 9 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/scanner/token.dart
diff --git a/pkg/front_end/lib/src/scanner/token.dart b/pkg/front_end/lib/src/scanner/token.dart
index 2824fdcb2eb660bef8e07206022008b5bb427260..d1facd3ba5ee0c5c055949a460887045da59e45d 100644
--- a/pkg/front_end/lib/src/scanner/token.dart
+++ b/pkg/front_end/lib/src/scanner/token.dart
@@ -985,10 +985,10 @@ class TokenType {
const TokenType._('HASH', TokenClass.NO_CLASS, '#');
static const TokenType INDEX =
- const TokenType._('INDEX', TokenClass.UNARY_POSTFIX_OPERATOR, '[]');
+ const TokenType._('INDEX', TokenClass.NO_CLASS, '[]');
static const TokenType INDEX_EQ =
- const TokenType._('INDEX_EQ', TokenClass.UNARY_POSTFIX_OPERATOR, '[]=');
+ const TokenType._('INDEX_EQ', TokenClass.NO_CLASS, '[]=');
static const TokenType LT =
const TokenType._('LT', TokenClass.RELATIONAL_OPERATOR, '<');
@@ -1009,7 +1009,7 @@ class TokenType {
const TokenType._('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '-=');
static const TokenType MINUS_MINUS =
- const TokenType._('MINUS_MINUS', TokenClass.UNARY_PREFIX_OPERATOR, '--');
+ const TokenType._('MINUS_MINUS', TokenClass.UNARY_POSTFIX_OPERATOR, '--');
static const TokenType OPEN_CURLY_BRACKET =
const TokenType._('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, '{');
@@ -1039,7 +1039,7 @@ class TokenType {
const TokenType._('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '+=');
static const TokenType PLUS_PLUS =
- const TokenType._('PLUS_PLUS', TokenClass.UNARY_PREFIX_OPERATOR, '++');
+ const TokenType._('PLUS_PLUS', TokenClass.UNARY_POSTFIX_OPERATOR, '++');
static const TokenType QUESTION =
const TokenType._('QUESTION', TokenClass.CONDITIONAL_OPERATOR, '?');
@@ -1174,10 +1174,12 @@ class TokenType {
* Return `true` if this token type represents an operator.
*/
bool get isOperator =>
- _tokenClass != TokenClass.NO_CLASS &&
- this != OPEN_PAREN &&
- this != OPEN_SQUARE_BRACKET &&
- this != PERIOD;
+ this == INDEX ||
+ this == INDEX_EQ ||
+ (_tokenClass != TokenClass.NO_CLASS &&
+ this != OPEN_PAREN &&
+ this != OPEN_SQUARE_BRACKET &&
+ this != PERIOD);
/**
* Return `true` if this type of token represents a relational operator.

Powered by Google App Engine
This is Rietveld 408576698