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

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

Issue 8508016: Create class AST nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: frogsh 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/parser.dart ('k') | dart/frog/leg/scanner/scanner_task.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 * A benchmark for the Dart parser. 6 * A benchmark for the Dart parser.
7 */ 7 */
8 class ParserBench extends BaseParserBench { 8 class ParserBench extends BaseParserBench {
9 Token scanFileNamed(String filename) { 9 Token scanFileNamed(String filename) {
10 Token token; 10 Token token;
(...skipping 25 matching lines...) Expand all
36 Listener listener = new BenchListener(); 36 Listener listener = new BenchListener();
37 for (String argument in arguments) { 37 for (String argument in arguments) {
38 parseFileNamed(argument, listener); 38 parseFileNamed(argument, listener);
39 } 39 }
40 return listener; 40 return listener;
41 } 41 }
42 42
43 void parseFileNamed(String argument, Listener listener) { 43 void parseFileNamed(String argument, Listener listener) {
44 bool failed = true; 44 bool failed = true;
45 try { 45 try {
46 Parser parser = new Parser(listener); 46 PartialParser parser = new PartialParser(listener);
47 parser.parseUnit(scanFileNamed(argument)); 47 parser.parseUnit(scanFileNamed(argument));
48 failed = false; 48 failed = false;
49 } finally { 49 } finally {
50 if (failed) print('Error in ${argument}'); 50 if (failed) print('Error in ${argument}');
51 } 51 }
52 } 52 }
53 53
54 void main(List<String> arguments) { 54 void main(List<String> arguments) {
55 for (int i = 0; i < 10; i++) { 55 for (int i = 0; i < 10; i++) {
56 timedParseAll(arguments); 56 timedParseAll(arguments);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 void beginClass(Token token) { 95 void beginClass(Token token) {
96 classCount++; 96 classCount++;
97 } 97 }
98 98
99 void beginFunctionTypeAlias(Token token) { 99 void beginFunctionTypeAlias(Token token) {
100 aliasCount++; 100 aliasCount++;
101 } 101 }
102 } 102 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698