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

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

Issue 368833002: Cleanup warnings in unit tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix outdated type annotations. Created 6 years, 5 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 | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/patch_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 "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 import "package:compiler/implementation/elements/elements.dart"; 9 import "package:compiler/implementation/elements/elements.dart";
10 import "package:compiler/implementation/tree/tree.dart"; 10 import "package:compiler/implementation/tree/tree.dart";
11 import "package:compiler/implementation/scanner/scannerlib.dart"; 11 import "package:compiler/implementation/scanner/scannerlib.dart";
12 import "package:compiler/implementation/source_file.dart"; 12 import "package:compiler/implementation/source_file.dart";
13 import "package:compiler/implementation/util/util.dart"; 13 import "package:compiler/implementation/util/util.dart";
14 14
15 import "package:compiler/implementation/elements/modelx.dart" 15 import "package:compiler/implementation/elements/modelx.dart"
16 show CompilationUnitElementX, 16 show CompilationUnitElementX, ElementX, LibraryElementX;
17 LibraryElementX;
18 17
19 import "package:compiler/implementation/dart2jslib.dart"; 18 import "package:compiler/implementation/dart2jslib.dart";
20 19
21 export "package:compiler/implementation/dart2jslib.dart" 20 export "package:compiler/implementation/dart2jslib.dart"
22 show DiagnosticListener; 21 show DiagnosticListener;
23 // TODO(ahe): We should have token library to export instead. 22 // TODO(ahe): We should have token library to export instead.
24 export "package:compiler/implementation/scanner/scannerlib.dart"; 23 export "package:compiler/implementation/scanner/scannerlib.dart";
25 24
26 class LoggerCanceler implements DiagnosticListener { 25 class LoggerCanceler implements DiagnosticListener {
27 void cancel(String reason, {node, token, instruction, element}) { 26 void cancel(String reason, {node, token, instruction, element}) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 Node node = listener.popNode(); 86 Node node = listener.popNode();
88 Expect.isNotNull(node); 87 Expect.isNotNull(node);
89 Expect.isTrue(listener.nodes.isEmpty, 'Not empty: ${listener.nodes}'); 88 Expect.isTrue(listener.nodes.isEmpty, 'Not empty: ${listener.nodes}');
90 return node; 89 return node;
91 } 90 }
92 91
93 Node parseStatement(String text) => 92 Node parseStatement(String text) =>
94 parseBodyCode(text, (parser, tokens) => parser.parseStatement(tokens)); 93 parseBodyCode(text, (parser, tokens) => parser.parseStatement(tokens));
95 94
96 Node parseFunction(String text, Compiler compiler) { 95 Node parseFunction(String text, Compiler compiler) {
97 Element element = parseUnit(text, compiler, compiler.mainApp).head; 96 ElementX element = parseUnit(text, compiler, compiler.mainApp).head;
98 Expect.isNotNull(element); 97 Expect.isNotNull(element);
99 Expect.equals(ElementKind.FUNCTION, element.kind); 98 Expect.equals(ElementKind.FUNCTION, element.kind);
100 return element.parseNode(compiler); 99 return element.parseNode(compiler);
101 } 100 }
102 101
103 Node parseMember(String text, {DiagnosticListener diagnosticHandler}) { 102 Node parseMember(String text, {DiagnosticListener diagnosticHandler}) {
104 return parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens), 103 return parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens),
105 diagnosticHandler: diagnosticHandler); 104 diagnosticHandler: diagnosticHandler);
106 } 105 }
107 106
(...skipping 18 matching lines...) Expand all
126 ElementListener listener = new ElementListener(compiler, unit, () => id++); 125 ElementListener listener = new ElementListener(compiler, unit, () => id++);
127 PartialParser parser = new PartialParser(listener); 126 PartialParser parser = new PartialParser(listener);
128 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); 127 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens));
129 return unit.localMembers; 128 return unit.localMembers;
130 } 129 }
131 130
132 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) { 131 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) {
133 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens), 132 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens),
134 diagnosticHandler: diagnosticHandler); 133 diagnosticHandler: diagnosticHandler);
135 } 134 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698