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

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

Issue 1312613006: Add command-line parameter enabling assert messages. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/scanner/scanner_task.dart ('k') | no next file » | 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/src/elements/elements.dart"; 9 import "package:compiler/src/elements/elements.dart";
10 import "package:compiler/src/tree/tree.dart"; 10 import "package:compiler/src/tree/tree.dart";
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 [void registerSource(Uri uri, String source)]) { 118 [void registerSource(Uri uri, String source)]) {
119 Token tokens = scan(text); 119 Token tokens = scan(text);
120 Uri uri = new Uri(scheme: "source", path: '${++sourceCounter}'); 120 Uri uri = new Uri(scheme: "source", path: '${++sourceCounter}');
121 if (registerSource != null) { 121 if (registerSource != null) {
122 registerSource(uri, text); 122 registerSource(uri, text);
123 } 123 }
124 var script = new Script(uri, uri, new MockFile(text)); 124 var script = new Script(uri, uri, new MockFile(text));
125 var unit = new CompilationUnitElementX(script, library); 125 var unit = new CompilationUnitElementX(script, library);
126 int id = 0; 126 int id = 0;
127 ElementListener listener = new ElementListener(compiler, unit, () => id++); 127 ElementListener listener = new ElementListener(compiler, unit, () => id++);
128 PartialParser parser = new PartialParser(listener); 128 PartialParser parser =
129 new PartialParser(listener,
130 allowAssertMessage: compiler.allowAssertMessage);
129 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); 131 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens));
130 return unit.localMembers; 132 return unit.localMembers;
131 } 133 }
132 134
133 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) { 135 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) {
134 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens), 136 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens),
135 diagnosticHandler: diagnosticHandler); 137 diagnosticHandler: diagnosticHandler);
136 } 138 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/scanner/scanner_task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698