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

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

Issue 2749033003: fasta.Token implement analyzer.Token.isOperator (Closed)
Patch Set: merge 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 library fasta.scanner.token; 5 library fasta.scanner.token;
6 6
7 import 'keyword.dart' show Keyword; 7 import 'keyword.dart' show Keyword;
8 8
9 import 'precedence.dart' show BAD_INPUT_INFO, EOF_INFO, PrecedenceInfo; 9 import 'precedence.dart' show BAD_INPUT_INFO, EOF_INFO, PrecedenceInfo;
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return 1; 116 return 1;
117 } else { 117 } else {
118 return lexeme.length; 118 return lexeme.length;
119 } 119 }
120 } 120 }
121 121
122 /// The character offset of the end of this token within the source text. 122 /// The character offset of the end of this token within the source text.
123 int get charEnd => charOffset + charCount; 123 int get charEnd => charOffset + charCount;
124 124
125 bool get isEof => false; 125 bool get isEof => false;
126
127 @override
128 bool get isOperator => info.isOperator;
126 } 129 }
127 130
128 /** 131 /**
129 * A [SymbolToken] represents the symbol in its precedence info. 132 * A [SymbolToken] represents the symbol in its precedence info.
130 * Also used for end of file with EOF_INFO. 133 * Also used for end of file with EOF_INFO.
131 */ 134 */
132 class SymbolToken extends Token { 135 class SymbolToken extends Token {
133 final PrecedenceInfo info; 136 final PrecedenceInfo info;
134 137
135 SymbolToken(this.info, int charOffset) : super(charOffset); 138 SymbolToken(this.info, int charOffset) : super(charOffset);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 identical(value, "<=") || 371 identical(value, "<=") ||
369 identical(value, "<") || 372 identical(value, "<") ||
370 identical(value, "&") || 373 identical(value, "&") ||
371 identical(value, "^") || 374 identical(value, "^") ||
372 identical(value, "|"); 375 identical(value, "|");
373 } 376 }
374 377
375 bool isTernaryOperator(String value) => identical(value, "[]="); 378 bool isTernaryOperator(String value) => identical(value, "[]=");
376 379
377 bool isMinusOperator(String value) => identical(value, "-"); 380 bool isMinusOperator(String value) => identical(value, "-");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698