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

Side by Side Diff: frog/tests/leg/parser_helper.dart

Issue 10310040: Sort the output (for now just the classes and instance members). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 8 years, 7 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 final text; 52 final text;
53 MockFile(this.text); 53 MockFile(this.text);
54 } 54 }
55 55
56 Link<Element> parseUnit(String text, Compiler compiler, 56 Link<Element> parseUnit(String text, Compiler compiler,
57 LibraryElement library) { 57 LibraryElement library) {
58 Token tokens = scan(text); 58 Token tokens = scan(text);
59 Uri uri = new Uri(scheme: "source"); 59 Uri uri = new Uri(scheme: "source");
60 var script = new Script(uri, new MockFile(text)); 60 var script = new Script(uri, new MockFile(text));
61 var unit = new CompilationUnitElement(script, library); 61 var unit = new CompilationUnitElement(script, library);
62 ElementListener listener = new ElementListener(compiler, unit); 62 int id = 0;
63 ElementListener listener = new ElementListener(compiler, unit, () => id++);
63 PartialParser parser = new PartialParser(listener); 64 PartialParser parser = new PartialParser(listener);
64 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); 65 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens));
65 return unit.topLevelElements; 66 return unit.topLevelElements;
66 } 67 }
67 68
68 // TODO(ahe): We define this method to avoid having to import 69 // TODO(ahe): We define this method to avoid having to import
69 // the scanner in the tests. We should move SourceString to another 70 // the scanner in the tests. We should move SourceString to another
70 // location instead. 71 // location instead.
71 SourceString buildSourceString(String name) { 72 SourceString buildSourceString(String name) {
72 return new SourceString(name); 73 return new SourceString(name);
73 } 74 }
OLDNEW
« no previous file with comments | « frog/tests/leg/class_order_test.dart ('k') | lib/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698