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

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

Issue 10703188: Allow patch files to add top-level declarations to the patched library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix errors caught by editor. Created 8 years, 5 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 | « lib/compiler/implementation/lib/math.dartp ('k') | lib/compiler/implementation/resolver.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 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");
11 #import("scanner/scannerlib.dart"); // Scanner, Parsers, Listeners 11 #import("scanner/scannerlib.dart"); // Scanner, Parsers, Listeners
12 #import("elements/elements.dart"); 12 #import("elements/elements.dart");
13 #import('native_handler.dart', prefix: 'native'); 13 #import('native_handler.dart', prefix: 'native');
14 14
15
16 class PatchParserTask extends leg.CompilerTask { 15 class PatchParserTask extends leg.CompilerTask {
17 PatchParserTask(leg.Compiler compiler): super(compiler); 16 PatchParserTask(leg.Compiler compiler): super(compiler);
18 final String name = "Patching Parser"; 17 final String name = "Patching Parser";
19 18
20 LibraryElement loadPatchLibrary(Uri uri) { 19 LibraryElement loadPatchLibrary(Uri uri) {
21 bool newLibrary = false; 20 bool newLibrary = false;
22 LibraryElement library = 21 LibraryElement library =
23 compiler.libraries.putIfAbsent(uri.toString(), () { 22 compiler.libraries.putIfAbsent(uri.toString(), () {
24 newLibrary = true; 23 newLibrary = true;
25 leg.Script script = compiler.readScript(uri, null); 24 leg.Script script = compiler.readScript(uri, null);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 207 }
209 } 208 }
210 209
211 void addMember(Element element) { 210 void addMember(Element element) {
212 if (isMemberPatch || (isClassPatch && element is ClassElement)) { 211 if (isMemberPatch || (isClassPatch && element is ClassElement)) {
213 element.addMetadata(popNode()); 212 element.addMetadata(popNode());
214 } 213 }
215 super.addMember(element); 214 super.addMember(element);
216 } 215 }
217 } 216 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/math.dartp ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698