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

Side by Side Diff: pkg/front_end/lib/src/scanner/token.dart

Issue 2755433004: align fasta.PrecedenceInfo.precedence with analyzer.TokenType.precedence (Closed)
Patch Set: increase precedence of --/++ to 16 in fasta and analyzer 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Defines the tokens that are produced by the scanner, used by the parser, and 6 * Defines the tokens that are produced by the scanner, used by the parser, and
7 * referenced from the [AST structure](ast.dart). 7 * referenced from the [AST structure](ast.dart).
8 */ 8 */
9 import 'dart:collection'; 9 import 'dart:collection';
10 10
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 static const TokenType LT_LT_EQ = 1002 static const TokenType LT_LT_EQ =
1003 const TokenType._('LT_LT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '<<='); 1003 const TokenType._('LT_LT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '<<=');
1004 1004
1005 static const TokenType MINUS = 1005 static const TokenType MINUS =
1006 const TokenType._('MINUS', TokenClass.ADDITIVE_OPERATOR, '-'); 1006 const TokenType._('MINUS', TokenClass.ADDITIVE_OPERATOR, '-');
1007 1007
1008 static const TokenType MINUS_EQ = 1008 static const TokenType MINUS_EQ =
1009 const TokenType._('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '-='); 1009 const TokenType._('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '-=');
1010 1010
1011 static const TokenType MINUS_MINUS = 1011 static const TokenType MINUS_MINUS =
1012 const TokenType._('MINUS_MINUS', TokenClass.UNARY_PREFIX_OPERATOR, '--'); 1012 const TokenType._('MINUS_MINUS', TokenClass.UNARY_POSTFIX_OPERATOR, '--');
Brian Wilkerson 2017/03/15 13:50:33 I'm not sure what the right answer is here. Note t
1013 1013
1014 static const TokenType OPEN_CURLY_BRACKET = 1014 static const TokenType OPEN_CURLY_BRACKET =
1015 const TokenType._('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, '{'); 1015 const TokenType._('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, '{');
1016 1016
1017 static const TokenType OPEN_PAREN = 1017 static const TokenType OPEN_PAREN =
1018 const TokenType._('OPEN_PAREN', TokenClass.UNARY_POSTFIX_OPERATOR, '('); 1018 const TokenType._('OPEN_PAREN', TokenClass.UNARY_POSTFIX_OPERATOR, '(');
1019 1019
1020 static const TokenType OPEN_SQUARE_BRACKET = const TokenType._( 1020 static const TokenType OPEN_SQUARE_BRACKET = const TokenType._(
1021 'OPEN_SQUARE_BRACKET', TokenClass.UNARY_POSTFIX_OPERATOR, '['); 1021 'OPEN_SQUARE_BRACKET', TokenClass.UNARY_POSTFIX_OPERATOR, '[');
1022 1022
1023 static const TokenType PERCENT = 1023 static const TokenType PERCENT =
1024 const TokenType._('PERCENT', TokenClass.MULTIPLICATIVE_OPERATOR, '%'); 1024 const TokenType._('PERCENT', TokenClass.MULTIPLICATIVE_OPERATOR, '%');
1025 1025
1026 static const TokenType PERCENT_EQ = 1026 static const TokenType PERCENT_EQ =
1027 const TokenType._('PERCENT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '%='); 1027 const TokenType._('PERCENT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '%=');
1028 1028
1029 static const TokenType PERIOD = 1029 static const TokenType PERIOD =
1030 const TokenType._('PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '.'); 1030 const TokenType._('PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '.');
1031 1031
1032 static const TokenType PERIOD_PERIOD = 1032 static const TokenType PERIOD_PERIOD =
1033 const TokenType._('PERIOD_PERIOD', TokenClass.CASCADE_OPERATOR, '..'); 1033 const TokenType._('PERIOD_PERIOD', TokenClass.CASCADE_OPERATOR, '..');
1034 1034
1035 static const TokenType PLUS = 1035 static const TokenType PLUS =
1036 const TokenType._('PLUS', TokenClass.ADDITIVE_OPERATOR, '+'); 1036 const TokenType._('PLUS', TokenClass.ADDITIVE_OPERATOR, '+');
1037 1037
1038 static const TokenType PLUS_EQ = 1038 static const TokenType PLUS_EQ =
1039 const TokenType._('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '+='); 1039 const TokenType._('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '+=');
1040 1040
1041 static const TokenType PLUS_PLUS = 1041 static const TokenType PLUS_PLUS =
1042 const TokenType._('PLUS_PLUS', TokenClass.UNARY_PREFIX_OPERATOR, '++'); 1042 const TokenType._('PLUS_PLUS', TokenClass.UNARY_POSTFIX_OPERATOR, '++');
1043 1043
1044 static const TokenType QUESTION = 1044 static const TokenType QUESTION =
1045 const TokenType._('QUESTION', TokenClass.CONDITIONAL_OPERATOR, '?'); 1045 const TokenType._('QUESTION', TokenClass.CONDITIONAL_OPERATOR, '?');
1046 1046
1047 static const TokenType QUESTION_PERIOD = const TokenType._( 1047 static const TokenType QUESTION_PERIOD = const TokenType._(
1048 'QUESTION_PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '?.'); 1048 'QUESTION_PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '?.');
1049 1049
1050 static const TokenType QUESTION_QUESTION = 1050 static const TokenType QUESTION_QUESTION =
1051 const TokenType._('QUESTION_QUESTION', TokenClass.IF_NULL_OPERATOR, '??'); 1051 const TokenType._('QUESTION_QUESTION', TokenClass.IF_NULL_OPERATOR, '??');
1052 1052
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 */ 1275 */
1276 class _EndOfFileTokenType extends TokenType { 1276 class _EndOfFileTokenType extends TokenType {
1277 /** 1277 /**
1278 * Initialize a newly created token. 1278 * Initialize a newly created token.
1279 */ 1279 */
1280 const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, ''); 1280 const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, '');
1281 1281
1282 @override 1282 @override
1283 String toString() => '-eof-'; 1283 String toString() => '-eof-';
1284 } 1284 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/precedence.dart ('k') | pkg/front_end/test/scanner_roundtrip_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698