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

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

Issue 2747683003: update fasta scanner to always generate INDEX or INDEX_EQ tokens (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) 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
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 Token token = previousToken(); 438 return select($EQ, INDEX_EQ_INFO, INDEX_INFO);
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 }
443 } 439 }
444 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO); 440 appendBeginGroup(OPEN_SQUARE_BRACKET_INFO);
445 return next; 441 return next;
446 } 442 }
447 443
448 int tokenizeCaret(int next) { 444 int tokenizeCaret(int next) {
449 // ^ ^= 445 // ^ ^=
450 return select($EQ, CARET_EQ_INFO, CARET_INFO); 446 return select($EQ, CARET_EQ_INFO, CARET_INFO);
451 } 447 }
452 448
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 switchToUint32(newLength); 1241 switchToUint32(newLength);
1246 } 1242 }
1247 } 1243 }
1248 1244
1249 void switchToUint32(int newLength) { 1245 void switchToUint32(int newLength) {
1250 final newArray = new Uint32List(newLength); 1246 final newArray = new Uint32List(newLength);
1251 newArray.setRange(0, arrayLength, array); 1247 newArray.setRange(0, arrayLength, array);
1252 array = newArray; 1248 array = newArray;
1253 } 1249 }
1254 } 1250 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698