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

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

Issue 8879052: Add --ast to mini_parser.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: More failures after merging with Florian's constructor changes Created 9 years 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/scanner/parser.dart ('k') | dart/frog/leg/tools/mini_parser.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 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 12 matching lines...) Expand all
23 if ((value !== '<') && (token is BeginGroupToken)) { 23 if ((value !== '<') && (token is BeginGroupToken)) {
24 BeginGroupToken begin = token; 24 BeginGroupToken begin = token;
25 token = (begin.endGroup !== null) ? begin.endGroup : token; 25 token = (begin.endGroup !== null) ? begin.endGroup : token;
26 } 26 }
27 token = token.next; 27 token = token.next;
28 } 28 }
29 } 29 }
30 30
31 Token parseFunctionBody(Token token, bool isExpression) { 31 Token parseFunctionBody(Token token, bool isExpression) {
32 assert(!isExpression); 32 assert(!isExpression);
33 if (optional(';', token)) { 33 String value = token.stringValue;
34 listener.handleNoFunctionBody(token); 34 if (value === ';') {
35 return token; 35 // No body.
36 } else if (optional('=>', token)) { 36 } else if (value === '=>') {
37 token = parseExpression(token.next); 37 token = parseExpression(token.next);
38 expectSemicolon(token); 38 expectSemicolon(token);
39 return token;
40 } else { 39 } else {
41 token = skipBlock(token); 40 token = skipBlock(token);
42 listener.handleNoFunctionBody(token);
43 return token;
44 } 41 }
42 // There is no "skipped function body event", so we use
43 // handleNoFunctionBody instead.
44 listener.handleNoFunctionBody(token);
45 return token;
46 }
47
48 Token parseFormalParameters(Token token) => skipFormals(token);
49
50 Token skipFormals(BeginGroupToken token) {
51 listener.beginOptionalFormalParameters(token);
52 expect('(', token);
53 Token endToken = token.endGroup;
54 listener.endFormalParameters(0, token, endToken);
55 return endToken.next;
45 } 56 }
46 } 57 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/tools/mini_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698