| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 abstract class Scanner { | 7 abstract class Scanner { |
| 8 Token tokenize(); | 8 Token tokenize(); |
| 9 | 9 |
| 10 factory Scanner(SourceFile file, {bool includeComments: false}) { | 10 factory Scanner(SourceFile file, {bool includeComments: false}) { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 appendPrecedenceToken(TILDE_INFO); | 429 appendPrecedenceToken(TILDE_INFO); |
| 430 return next; | 430 return next; |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 | 433 |
| 434 int tokenizeOpenSquareBracket(int next) { | 434 int tokenizeOpenSquareBracket(int next) { |
| 435 // [ [] []= | 435 // [ [] []= |
| 436 next = advance(); | 436 next = advance(); |
| 437 if (identical(next, $CLOSE_SQUARE_BRACKET)) { | 437 if (identical(next, $CLOSE_SQUARE_BRACKET)) { |
| 438 Token token = previousToken(); | 438 Token token = previousToken(); |
| 439 if (token is KeywordToken && | 439 if (token is KeywordToken && token.keyword.syntax == 'operator' || |
| 440 identical(token.keyword.syntax, 'operator')) { | 440 token is SymbolToken && token.info == HASH_INFO) { |
| 441 return select($EQ, INDEX_EQ_INFO, INDEX_INFO); | 441 return select($EQ, INDEX_EQ_INFO, INDEX_INFO); |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO); | 444 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO); |
| 445 return next; | 445 return next; |
| 446 } | 446 } |
| 447 | 447 |
| 448 int tokenizeCaret(int next) { | 448 int tokenizeCaret(int next) { |
| 449 // ^ ^= | 449 // ^ ^= |
| 450 return select($EQ, CARET_EQ_INFO, CARET_INFO); | 450 return select($EQ, CARET_EQ_INFO, CARET_INFO); |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 | 1146 |
| 1147 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { | 1147 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { |
| 1148 return const { | 1148 return const { |
| 1149 '(': CLOSE_PAREN_INFO, | 1149 '(': CLOSE_PAREN_INFO, |
| 1150 '[': CLOSE_SQUARE_BRACKET_INFO, | 1150 '[': CLOSE_SQUARE_BRACKET_INFO, |
| 1151 '{': CLOSE_CURLY_BRACKET_INFO, | 1151 '{': CLOSE_CURLY_BRACKET_INFO, |
| 1152 '<': GT_INFO, | 1152 '<': GT_INFO, |
| 1153 r'${': CLOSE_CURLY_BRACKET_INFO, | 1153 r'${': CLOSE_CURLY_BRACKET_INFO, |
| 1154 }[begin.value]; | 1154 }[begin.value]; |
| 1155 } | 1155 } |
| OLD | NEW |