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

Side by Side Diff: dart/frog/leg/scanner/partial_parser.dart

Issue 9355014: Two minor bug fixes: a type error in the parser, and throwing the (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « dart/frog/leg/lib/js_helper.dart ('k') | dart/tests/co19/co19-leg.status » ('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 class PartialParser extends Parser { 5 class PartialParser extends Parser {
6 PartialParser(Listener listener) : super(listener); 6 PartialParser(Listener listener) : super(listener);
7 7
8 Token parseClassBody(Token token) => skipBlock(token); 8 Token parseClassBody(Token token) => skipBlock(token);
9 9
10 Token fullParseClassBody(Token token) => super.parseClassBody(token); 10 Token fullParseClassBody(Token token) => super.parseClassBody(token);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 token = skipBlock(token); 42 token = skipBlock(token);
43 } 43 }
44 // There is no "skipped function body event", so we use 44 // There is no "skipped function body event", so we use
45 // handleNoFunctionBody instead. 45 // handleNoFunctionBody instead.
46 listener.handleNoFunctionBody(token); 46 listener.handleNoFunctionBody(token);
47 return token; 47 return token;
48 } 48 }
49 49
50 Token parseFormalParameters(Token token) => skipFormals(token); 50 Token parseFormalParameters(Token token) => skipFormals(token);
51 51
52 Token skipFormals(BeginGroupToken token) { 52 Token skipFormals(Token token) {
53 listener.beginOptionalFormalParameters(token); 53 listener.beginOptionalFormalParameters(token);
54 expect('(', token); 54 if (!optional('(', token)) {
55 Token endToken = token.endGroup; 55 if (optional(';', token)) {
56 listener.recoverableError("expected '('", token: token);
57 return token;
58 }
59 return listener.unexpected(token);
60 }
61 BeginGroupToken beginGroupToken = token;
62 Token endToken = beginGroupToken.endGroup;
56 listener.endFormalParameters(0, token, endToken); 63 listener.endFormalParameters(0, token, endToken);
57 return endToken.next; 64 return endToken.next;
58 } 65 }
59 } 66 }
OLDNEW
« no previous file with comments | « dart/frog/leg/lib/js_helper.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698