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

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

Issue 10540073: Properly parse > in end of types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Better tests 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 | « frog/tests/leg/unparser_test.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/parser.dart
diff --git a/lib/compiler/implementation/scanner/parser.dart b/lib/compiler/implementation/scanner/parser.dart
index 0bf9fe69f5cbbf40212f429ba6f7ea8f9e1f1862..a7899f9cdf61c020b04a3ab7d7c4b4e4fc871b1b 100644
--- a/lib/compiler/implementation/scanner/parser.dart
+++ b/lib/compiler/implementation/scanner/parser.dart
@@ -261,17 +261,6 @@ class Parser {
Token expect(String string, Token token) {
if (string !== token.stringValue) {
- if (string === '>') {
- if (token.stringValue === '>>') {
- Token gt = new Token(GT_INFO, token.charOffset + 1);
- gt.next = token.next;
- return gt;
- } else if (token.stringValue === '>>>') {
- Token gtgt = new Token(GT_GT_INFO, token.charOffset + 1);
- gtgt.next = token.next;
- return gtgt;
- }
- }
return listener.expected(string, token);
}
return token.next;
@@ -335,6 +324,16 @@ class Parser {
token = stuffParser(token.next);
++count;
} while (optional(',', token));
+ Token next = token.next;
+ if (token.stringValue === '>>') {
+ token = new Token(GT_INFO, token.charOffset);
+ token.next = new Token(GT_INFO, token.charOffset + 1);
+ token.next.next = next;
+ } else if (token.stringValue === '>>>') {
+ token = new Token(GT_INFO, token.charOffset);
+ token.next = new Token(GT_GT_INFO, token.charOffset + 1);
+ token.next.next = next;
+ }
endStuff(count, begin, token);
return expect('>', token);
}
« no previous file with comments | « frog/tests/leg/unparser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698