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

Unified Diff: frog/tests/leg/parser_helper.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg/parameter_phi_elimination_test.dart ('k') | frog/tests/leg/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/parser_helper.dart
===================================================================
--- frog/tests/leg/parser_helper.dart (revision 8644)
+++ frog/tests/leg/parser_helper.dart (working copy)
@@ -1,74 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#library('parser_helper');
-
-#import("dart:uri");
-
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-
-class LoggerCanceler implements DiagnosticListener {
- void cancel([String reason, node, token, instruction, element]) {
- throw new CompilerCancelledException(reason);
- }
-
- void log(message) {
- print(message);
- }
-}
-
-Token scan(String text) => new StringScanner(text).tokenize();
-
-Node parseBodyCode(String text, Function parseMethod) {
- Token tokens = scan(text);
- LoggerCanceler lc = new LoggerCanceler();
- NodeListener listener = new NodeListener(lc, null);
- Parser parser = new Parser(listener);
- Token endToken = parseMethod(parser, tokens);
- assert(endToken.kind == EOF_TOKEN);
- Node node = listener.popNode();
- Expect.isNotNull(node);
- Expect.isTrue(listener.nodes.isEmpty(), 'Not empty: ${listener.nodes}');
- return node;
-}
-
-Node parseStatement(String text) =>
- parseBodyCode(text, (parser, tokens) => parser.parseStatement(tokens));
-
-Node parseFunction(String text, Compiler compiler) {
- Element element = parseUnit(text, compiler, compiler.mainApp).head;
- Expect.isNotNull(element);
- Expect.equals(ElementKind.FUNCTION, element.kind);
- return element.parseNode(compiler);
-}
-
-class MockFile {
- final filename = '<string>';
- final text;
- MockFile(this.text);
-}
-
-Link<Element> parseUnit(String text, Compiler compiler,
- LibraryElement library) {
- Token tokens = scan(text);
- Uri uri = new Uri(scheme: "source");
- var script = new Script(uri, new MockFile(text));
- var unit = new CompilationUnitElement(script, library);
- int id = 0;
- ElementListener listener = new ElementListener(compiler, unit, () => id++);
- PartialParser parser = new PartialParser(listener);
- compiler.withCurrentElement(unit, () => parser.parseUnit(tokens));
- return unit.topLevelElements;
-}
-
-// TODO(ahe): We define this method to avoid having to import
-// the scanner in the tests. We should move SourceString to another
-// location instead.
-SourceString buildSourceString(String name) {
- return new SourceString(name);
-}
« no previous file with comments | « frog/tests/leg/parameter_phi_elimination_test.dart ('k') | frog/tests/leg/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698