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

Unified Diff: lib/compiler/implementation/scanner/scanner.dart

Issue 10519011: Properly parse []. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/scanner/array_based_scanner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/scanner.dart
diff --git a/lib/compiler/implementation/scanner/scanner.dart b/lib/compiler/implementation/scanner/scanner.dart
index ff2a93e88d1ff34ca556d1d9ddd14a2b2b98f4c0..2dd4d38891b8ceed534189afce0409ad42be88c2 100644
--- a/lib/compiler/implementation/scanner/scanner.dart
+++ b/lib/compiler/implementation/scanner/scanner.dart
@@ -23,6 +23,7 @@ class AbstractScanner<T extends SourceString> implements Scanner {
abstract T asciiString(int start, int offset);
abstract T utf8String(int start, int offset);
abstract Token firstToken();
+ abstract Token previousToken();
abstract void beginToken();
abstract void addToCharOffset(int offset);
abstract int get charOffset();
@@ -243,11 +244,13 @@ class AbstractScanner<T extends SourceString> implements Scanner {
// [ [] []=
next = advance();
if (next === $CLOSE_SQUARE_BRACKET) {
- return select($EQ, INDEX_EQ_INFO, INDEX_INFO);
- } else {
- appendBeginGroup(OPEN_SQUARE_BRACKET_INFO, "[");
- return next;
+ Token token = previousToken();
+ if (token is KeywordToken && token.value == Keyword.OPERATOR) {
+ return select($EQ, INDEX_EQ_INFO, INDEX_INFO);
+ }
}
+ appendBeginGroup(OPEN_SQUARE_BRACKET_INFO, "[");
+ return next;
}
int tokenizeCaret(int next) {
« no previous file with comments | « lib/compiler/implementation/scanner/array_based_scanner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698