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 library fasta.scanner.abstract_scanner; | 5 library fasta.scanner.abstract_scanner; |
6 | 6 |
7 import 'dart:collection' show ListMixin; | 7 import 'dart:collection' show ListMixin; |
8 | 8 |
9 import 'dart:typed_data' show Uint16List, Uint32List; | 9 import 'dart:typed_data' show Uint16List, Uint32List; |
10 | 10 |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } else { | 428 } else { |
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 return select($EQ, INDEX_EQ_INFO, INDEX_INFO); | 438 Token token = previousToken(); |
| 439 if (token is KeywordToken && token.keyword.syntax == 'operator' || |
| 440 token is SymbolToken && token.info == HASH_INFO) { |
| 441 return select($EQ, INDEX_EQ_INFO, INDEX_INFO); |
| 442 } |
439 } | 443 } |
440 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO); | 444 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO); |
441 return next; | 445 return next; |
442 } | 446 } |
443 | 447 |
444 int tokenizeCaret(int next) { | 448 int tokenizeCaret(int next) { |
445 // ^ ^= | 449 // ^ ^= |
446 return select($EQ, CARET_EQ_INFO, CARET_INFO); | 450 return select($EQ, CARET_EQ_INFO, CARET_INFO); |
447 } | 451 } |
448 | 452 |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 switchToUint32(newLength); | 1245 switchToUint32(newLength); |
1242 } | 1246 } |
1243 } | 1247 } |
1244 | 1248 |
1245 void switchToUint32(int newLength) { | 1249 void switchToUint32(int newLength) { |
1246 final newArray = new Uint32List(newLength); | 1250 final newArray = new Uint32List(newLength); |
1247 newArray.setRange(0, arrayLength, array); | 1251 newArray.setRange(0, arrayLength, array); |
1248 array = newArray; | 1252 array = newArray; |
1249 } | 1253 } |
1250 } | 1254 } |
OLD | NEW |