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

Unified Diff: dart/frog/leg/scanner/parser.dart

Issue 9349014: Fix NPE in parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 10 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 | « no previous file | dart/tests/language/src/SyntaxTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/parser.dart
diff --git a/dart/frog/leg/scanner/parser.dart b/dart/frog/leg/scanner/parser.dart
index f2427bcb21a2508ed5b0fdb59749ba74d6ad655e..306f082494ecdd69447a564df15a57a84f9cf69d 100644
--- a/dart/frog/leg/scanner/parser.dart
+++ b/dart/frog/leg/scanner/parser.dart
@@ -317,7 +317,14 @@ class Parser {
Token parseTypeVariablesOpt(Token token) {
if (optional('<', token)) {
BeginGroupToken beginGroupToken = token;
- token = beginGroupToken.endGroup.next;
+ // TODO(ahe): Parse type variables.
+
+ // For now, skip to the matching '>' if it exists. Otherwise,
+ // don't advance and assume the caller will report some kind of
+ // error.
+ if (beginGroupToken.endGroup !== null) {
+ token = beginGroupToken.endGroup.next;
+ }
}
listener.handleNoTypeVariables(token);
return token;
« no previous file with comments | « no previous file | dart/tests/language/src/SyntaxTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698