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

Side by Side Diff: frog/tests/leg/src/compiler_helper.dart

Issue 9873021: Move frog/leg to lib/compiler/implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « frog/tests/leg/src/TypeCheckerTest.dart ('k') | frog/tests/leg/src/mock_compiler.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 // Test constant folding. 4 // Test constant folding.
5 5
6 #library("compiler_helper"); 6 #library("compiler_helper");
7 7
8 #import('../../../../lib/uri/uri.dart'); 8 #import('../../../../lib/uri/uri.dart');
9 #import("../../../leg/leg.dart", prefix: "leg"); 9 #import("../../../../lib/compiler/implementation/leg.dart", prefix: "leg");
10 #import("../../../leg/elements/elements.dart", prefix: "lego"); 10 #import("../../../../lib/compiler/implementation/elements/elements.dart", prefix : "lego");
11 #import("../../../leg/ssa/ssa.dart", prefix: "ssa"); 11 #import("../../../../lib/compiler/implementation/ssa/ssa.dart", prefix: "ssa");
12 #import("parser_helper.dart"); 12 #import("parser_helper.dart");
13 #import("mock_compiler.dart"); 13 #import("mock_compiler.dart");
14 14
15 String compile(String code, [String entry = 'main']) { 15 String compile(String code, [String entry = 'main']) {
16 MockCompiler compiler = new MockCompiler(); 16 MockCompiler compiler = new MockCompiler();
17 compiler.parseScript(code); 17 compiler.parseScript(code);
18 lego.Element element = compiler.mainApp.find(buildSourceString(entry)); 18 lego.Element element = compiler.mainApp.find(buildSourceString(entry));
19 if (element === null) return null; 19 if (element === null) return null;
20 String generated = compiler.compile(new leg.WorkItem.toCompile(element)); 20 String generated = compiler.compile(new leg.WorkItem.toCompile(element));
21 return generated; 21 return generated;
(...skipping 29 matching lines...) Expand all
51 String generated = compile(code, entry); 51 String generated = compile(code, entry);
52 Expect.isTrue(regexp.hasMatch(generated), 52 Expect.isTrue(regexp.hasMatch(generated),
53 '"$generated" does not match /$regexp/'); 53 '"$generated" does not match /$regexp/');
54 } 54 }
55 55
56 void compileAndDoNotMatch(String code, String entry, RegExp regexp) { 56 void compileAndDoNotMatch(String code, String entry, RegExp regexp) {
57 String generated = compile(code, entry); 57 String generated = compile(code, entry);
58 Expect.isFalse(regexp.hasMatch(generated), 58 Expect.isFalse(regexp.hasMatch(generated),
59 '"$generated" has a match in /$regexp/'); 59 '"$generated" has a match in /$regexp/');
60 } 60 }
OLDNEW
« no previous file with comments | « frog/tests/leg/src/TypeCheckerTest.dart ('k') | frog/tests/leg/src/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698