OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |