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

Side by Side 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: changes 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tests/language/src/SyntaxTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * An event generating parser of Dart programs. This parser expects 6 * An event generating parser of Dart programs. This parser expects
7 * all tokens in a linked list. 7 * all tokens in a linked list.
8 */ 8 */
9 class Parser { 9 class Parser {
10 final Listener listener; 10 final Listener listener;
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 return parseStuff(token, 310 return parseStuff(token,
311 (t) => listener.beginTypeArguments(t), 311 (t) => listener.beginTypeArguments(t),
312 (t) => parseType(t), 312 (t) => parseType(t),
313 (c, bt, et) => listener.endTypeArguments(c, bt, et), 313 (c, bt, et) => listener.endTypeArguments(c, bt, et),
314 (t) => listener.handleNoTypeArguments(t)); 314 (t) => listener.handleNoTypeArguments(t));
315 } 315 }
316 316
317 Token parseTypeVariablesOpt(Token token) { 317 Token parseTypeVariablesOpt(Token token) {
318 if (optional('<', token)) { 318 if (optional('<', token)) {
319 BeginGroupToken beginGroupToken = token; 319 BeginGroupToken beginGroupToken = token;
320 token = beginGroupToken.endGroup.next; 320 if (beginGroupToken.endGroup !== null) {
ngeoffray 2012/02/07 13:40:27 Please add a comment that you're considering the f
ahe 2012/02/07 14:24:47 Done.
321 token = beginGroupToken.endGroup.next;
322 }
321 } 323 }
322 listener.handleNoTypeVariables(token); 324 listener.handleNoTypeVariables(token);
323 return token; 325 return token;
324 } 326 }
325 327
326 Token parseTypeVariablesOptX(Token token) { 328 Token parseTypeVariablesOptX(Token token) {
327 return parseStuff(token, 329 return parseStuff(token,
328 (t) => listener.beginTypeVariables(t), 330 (t) => listener.beginTypeVariables(t),
329 (t) => parseTypeVariable(t), 331 (t) => parseTypeVariable(t),
330 (c, bt, et) => listener.endTypeVariables(c, bt, et), 332 (c, bt, et) => listener.endTypeVariables(c, bt, et),
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 } 1615 }
1614 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1616 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1615 return expectSemicolon(token); 1617 return expectSemicolon(token);
1616 } 1618 }
1617 1619
1618 Token parseEmptyStatement(Token token) { 1620 Token parseEmptyStatement(Token token) {
1619 listener.handleEmptyStatement(token); 1621 listener.handleEmptyStatement(token);
1620 return expectSemicolon(token); 1622 return expectSemicolon(token);
1621 } 1623 }
1622 } 1624 }
OLDNEW
« 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