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

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

Issue 8462004: Integrate leg as a component in test.py. Also update presubmit script to run tests with leg. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 1 month 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/listener.dart ('k') | dart/frog/leg/typechecker.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 16 matching lines...) Expand all
27 switch (token.value) { 27 switch (token.value) {
28 case Keyword.INTERFACE: 28 case Keyword.INTERFACE:
29 token = parseInterface(token); 29 token = parseInterface(token);
30 break; 30 break;
31 case Keyword.CLASS: 31 case Keyword.CLASS:
32 token = parseClass(token); 32 token = parseClass(token);
33 break; 33 break;
34 case Keyword.TYPEDEF: 34 case Keyword.TYPEDEF:
35 token = parseNamedFunctionAlias(token); 35 token = parseNamedFunctionAlias(token);
36 break; 36 break;
37 case const SourceString("#"):
38 token = parseLibraryTags(token);
39 break;
40 default: 37 default:
41 token = parseTopLevelMember(token); 38 // TODO(ahe): Work around frog switch bug #314.
39 if (token.value == const SourceString("#")) {
40 token = parseLibraryTags(token);
41 } else {
42 token = parseTopLevelMember(token);
43 }
42 break; 44 break;
43 } 45 }
44 } 46 }
45 } 47 }
46 48
47 Token parseInterface(Token token) { 49 Token parseInterface(Token token) {
48 listener.beginInterface(token); 50 listener.beginInterface(token);
49 token = parseIdentifier(next(token)); 51 token = parseIdentifier(next(token));
50 token = parseTypeVariablesOpt(token); 52 token = parseTypeVariablesOpt(token);
51 token = parseSupertypesClauseOpt(token); 53 token = parseSupertypesClauseOpt(token);
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 576 }
575 577
576 Token parseBlock(Token token) { 578 Token parseBlock(Token token) {
577 token = expect(const SourceString('{'), token); 579 token = expect(const SourceString('{'), token);
578 while (!optional(const SourceString("}"), token)) { 580 while (!optional(const SourceString("}"), token)) {
579 token = parseStatement(token); 581 token = parseStatement(token);
580 } 582 }
581 return expect(const SourceString("}"), token); 583 return expect(const SourceString("}"), token);
582 } 584 }
583 } 585 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/leg/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698