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