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

Side by Side Diff: lib/compiler/implementation/patch_parser.dart

Issue 10824275: Revert "Refactor Library/CompilationUnit and how we define local Scope." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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("patchparser"); 5 #library("patchparser");
6 #import("dart:uri"); 6 #import("dart:uri");
7 7
8 #import("tree/tree.dart", prefix: "tree"); 8 #import("tree/tree.dart", prefix: "tree");
9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. 9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler.
10 #import("apiimpl.dart"); 10 #import("apiimpl.dart");
(...skipping 22 matching lines...) Expand all
33 scanLibraryElements(library); 33 scanLibraryElements(library);
34 compiler.onLibraryLoaded(library, uri); 34 compiler.onLibraryLoaded(library, uri);
35 }); 35 });
36 } 36 }
37 return library; 37 return library;
38 } 38 }
39 39
40 void scanLibraryElements(LibraryElement library) { 40 void scanLibraryElements(LibraryElement library) {
41 measure(() { 41 measure(() {
42 // TODO(lrn): Possibly recursively handle #source directives in patch. 42 // TODO(lrn): Possibly recursively handle #source directives in patch.
43 leg.Script script = library.entryCompilationUnit.script; 43 leg.Script script = library.script;
44 Token tokens = new StringScanner(script.text).tokenize(); 44 Token tokens = new StringScanner(script.text).tokenize();
45 Function idGenerator = compiler.getNextFreeClassId; 45 Function idGenerator = compiler.getNextFreeClassId;
46 PatchListener patchListener = 46 PatchListener patchListener =
47 new PatchElementListener(compiler, 47 new PatchElementListener(compiler, library, idGenerator);
48 library.entryCompilationUnit,
49 idGenerator);
50 new PatchParser(patchListener).parseUnit(tokens); 48 new PatchParser(patchListener).parseUnit(tokens);
51 }); 49 });
52 } 50 }
53 51
54 tree.ClassNode parsePatchClassNode(PartialClassElement element) { 52 tree.ClassNode parsePatchClassNode(PartialClassElement element) {
55 // Parse [PartialClassElement] using a "patch"-aware parser instead 53 // Parse [PartialClassElement] using a "patch"-aware parser instead
56 // of calling its [parseNode] method. 54 // of calling its [parseNode] method.
57 if (element.cachedNode != null) return element.cachedNode; 55 if (element.cachedNode != null) return element.cachedNode;
58 PatchMemberListener listener = 56 PatchMemberListener listener =
59 new PatchMemberListener(compiler, element); 57 new PatchMemberListener(compiler, element);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 208 }
211 } 209 }
212 210
213 void addMember(Element element) { 211 void addMember(Element element) {
214 if (isMemberPatch || (isClassPatch && element is ClassElement)) { 212 if (isMemberPatch || (isClassPatch && element is ClassElement)) {
215 element.addMetadata(popNode()); 213 element.addMetadata(popNode());
216 } 214 }
217 super.addMember(element); 215 super.addMember(element);
218 } 216 }
219 } 217 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698