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

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

Issue 10544173: Update partial parser and scanner to be able to skip expressions like "new Map<S, T>()". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
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
Index: dart/lib/compiler/implementation/scanner/array_based_scanner.dart
diff --git a/dart/lib/compiler/implementation/scanner/array_based_scanner.dart b/dart/lib/compiler/implementation/scanner/array_based_scanner.dart
index c3dfb5fc88c9dc003feef2910cb4624222f45dfa..c282f79421bd20689a70e3ff64c0137e13f306b1 100644
--- a/dart/lib/compiler/implementation/scanner/array_based_scanner.dart
+++ b/dart/lib/compiler/implementation/scanner/array_based_scanner.dart
@@ -49,6 +49,8 @@ class ArrayBasedScanner<S extends SourceString> extends AbstractScanner<S> {
}
void appendKeywordToken(Keyword keyword) {
+ final syntax = keyword.syntax;
Lasse Reichstein Nielsen 2012/06/15 11:51:13 Please write the type of the variable. In this cas
ahe 2012/06/15 13:12:34 Good point. Please be aware that when I'm writing
+ if (syntax === 'this' || syntax === 'super') discardOpenLt();
tail.next = new KeywordToken(keyword, tokenStart);
tail = tail.next;
}
@@ -90,11 +92,7 @@ class ArrayBasedScanner<S extends SourceString> extends AbstractScanner<S> {
Token token = new BeginGroupToken(info, value, tokenStart);
tail.next = token;
tail = tail.next;
- while (info.kind !== LT_TOKEN &&
- !groupingStack.isEmpty() &&
- groupingStack.head.kind === LT_TOKEN) {
- groupingStack = groupingStack.tail;
- }
+ if (info.kind !== LT_TOKEN) discardOpenLt();
groupingStack = groupingStack.prepend(token);
}

Powered by Google App Engine
This is Rietveld 408576698