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

Side by Side Diff: tests/compiler/dart2js/parser_helper.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 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 | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/parser_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library parser_helper; 5 library parser_helper;
6 6
7 import "dart:uri"; 7 import "dart:uri";
8 8
9 import "../../../lib/compiler/implementation/elements/elements.dart"; 9 import "../../../lib/compiler/implementation/elements/elements.dart";
10 import "../../../lib/compiler/implementation/tree/tree.dart"; 10 import "../../../lib/compiler/implementation/tree/tree.dart";
(...skipping 22 matching lines...) Expand all
33 new Uri.fromComponents(scheme: "source"), 33 new Uri.fromComponents(scheme: "source"),
34 new MockFile(text)); 34 new MockFile(text));
35 LibraryElement library = new LibraryElement(script); 35 LibraryElement library = new LibraryElement(script);
36 library.canUseNative = true; 36 library.canUseNative = true;
37 NodeListener listener = new NodeListener(lc, library.entryCompilationUnit); 37 NodeListener listener = new NodeListener(lc, library.entryCompilationUnit);
38 Parser parser = new Parser(listener); 38 Parser parser = new Parser(listener);
39 Token endToken = parseMethod(parser, tokens); 39 Token endToken = parseMethod(parser, tokens);
40 assert(endToken.kind == EOF_TOKEN); 40 assert(endToken.kind == EOF_TOKEN);
41 Node node = listener.popNode(); 41 Node node = listener.popNode();
42 Expect.isNotNull(node); 42 Expect.isNotNull(node);
43 Expect.isTrue(listener.nodes.isEmpty(), 'Not empty: ${listener.nodes}'); 43 Expect.isTrue(listener.nodes.isEmpty, 'Not empty: ${listener.nodes}');
44 return node; 44 return node;
45 } 45 }
46 46
47 Node parseStatement(String text) => 47 Node parseStatement(String text) =>
48 parseBodyCode(text, (parser, tokens) => parser.parseStatement(tokens)); 48 parseBodyCode(text, (parser, tokens) => parser.parseStatement(tokens));
49 49
50 Node parseFunction(String text, Compiler compiler) { 50 Node parseFunction(String text, Compiler compiler) {
51 Element element = parseUnit(text, compiler, compiler.mainApp).head; 51 Element element = parseUnit(text, compiler, compiler.mainApp).head;
52 Expect.isNotNull(element); 52 Expect.isNotNull(element);
53 Expect.equals(ElementKind.FUNCTION, element.kind); 53 Expect.equals(ElementKind.FUNCTION, element.kind);
(...skipping 24 matching lines...) Expand all
78 NodeList fullParseUnit(String source) { 78 NodeList fullParseUnit(String source) {
79 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens)); 79 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens));
80 } 80 }
81 81
82 // TODO(ahe): We define this method to avoid having to import 82 // TODO(ahe): We define this method to avoid having to import
83 // the scanner in the tests. We should move SourceString to another 83 // the scanner in the tests. We should move SourceString to another
84 // location instead. 84 // location instead.
85 SourceString buildSourceString(String name) { 85 SourceString buildSourceString(String name) {
86 return new SourceString(name); 86 return new SourceString(name);
87 } 87 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698