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 10702204: Revert "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: 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
15 class PatchParserTask extends leg.CompilerTask { 16 class PatchParserTask extends leg.CompilerTask {
16 PatchParserTask(leg.Compiler compiler): super(compiler); 17 PatchParserTask(leg.Compiler compiler): super(compiler);
17 final String name = "Patching Parser"; 18 final String name = "Patching Parser";
18 19
19 LibraryElement loadPatchLibrary(Uri uri) { 20 LibraryElement loadPatchLibrary(Uri uri) {
20 bool newLibrary = false; 21 bool newLibrary = false;
21 LibraryElement library = 22 LibraryElement library =
22 compiler.libraries.putIfAbsent(uri.toString(), () { 23 compiler.libraries.putIfAbsent(uri.toString(), () {
23 newLibrary = true; 24 newLibrary = true;
24 leg.Script script = compiler.readScript(uri, null); 25 leg.Script script = compiler.readScript(uri, null);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 208 }
208 } 209 }
209 210
210 void addMember(Element element) { 211 void addMember(Element element) {
211 if (isMemberPatch || (isClassPatch && element is ClassElement)) { 212 if (isMemberPatch || (isClassPatch && element is ClassElement)) {
212 element.addMetadata(popNode()); 213 element.addMetadata(popNode());
213 } 214 }
214 super.addMember(element); 215 super.addMember(element);
215 } 216 }
216 } 217 }
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