| 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 /** | 5 /** |
| 6 * This library contains the infrastructure to parse and integrate patch files. | 6 * This library contains the infrastructure to parse and integrate patch files. |
| 7 * | 7 * |
| 8 * Three types of elements can be patched: [LibraryElement], [ClassElement], | 8 * Three types of elements can be patched: [LibraryElement], [ClassElement], |
| 9 * [FunctionElement]. Patches are introduced in patch libraries which are loaded | 9 * [FunctionElement]. Patches are introduced in patch libraries which are loaded |
| 10 * together with the corresponding origin library. Which libraries that are | 10 * together with the corresponding origin library. Which libraries that are |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 * - Most maps and sets use declarations exclusively, and their individual | 104 * - Most maps and sets use declarations exclusively, and their individual |
| 105 * invariants are stated in the field comments. | 105 * invariants are stated in the field comments. |
| 106 * - [TreeElements] only map to patch elements from inside a patch library. | 106 * - [TreeElements] only map to patch elements from inside a patch library. |
| 107 * TODO(johnniwinther): Simplify this invariant to use only declarations in | 107 * TODO(johnniwinther): Simplify this invariant to use only declarations in |
| 108 * [TreeElements]. | 108 * [TreeElements]. |
| 109 * - Builders shift between declaration and implementation depending on usages. | 109 * - Builders shift between declaration and implementation depending on usages. |
| 110 * - Compile-time constants use constructor implementation exclusively. | 110 * - Compile-time constants use constructor implementation exclusively. |
| 111 * - Work on function parameters is performed on the declaration of the function | 111 * - Work on function parameters is performed on the declaration of the function |
| 112 * element. | 112 * element. |
| 113 */ | 113 */ |
| 114 #library("patchparser"); | |
| 115 | 114 |
| 116 #import("dart:uri"); | 115 library patchparser; |
| 117 #import("tree/tree.dart", prefix: "tree"); | 116 |
| 118 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. | 117 import "dart:uri"; |
| 119 #import("apiimpl.dart"); | 118 import "tree/tree.dart" as tree; |
| 120 #import("scanner/scannerlib.dart"); // Scanner, Parsers, Listeners | 119 import "dart2jslib.dart" as leg; // CompilerTask, Compiler. |
| 121 #import("elements/elements.dart"); | 120 import "apiimpl.dart"; |
| 122 #import('util/util.dart'); | 121 import "scanner/scannerlib.dart"; // Scanner, Parsers, Listeners |
| 122 import "elements/elements.dart"; |
| 123 import 'util/util.dart'; |
| 123 | 124 |
| 124 class PatchParserTask extends leg.CompilerTask { | 125 class PatchParserTask extends leg.CompilerTask { |
| 125 PatchParserTask(leg.Compiler compiler): super(compiler); | 126 PatchParserTask(leg.Compiler compiler): super(compiler); |
| 126 final String name = "Patching Parser"; | 127 final String name = "Patching Parser"; |
| 127 | 128 |
| 128 /** | 129 /** |
| 129 * Scans a library patch file, applies the method patches and | 130 * Scans a library patch file, applies the method patches and |
| 130 * injections to the library, and returns a list of class | 131 * injections to the library, and returns a list of class |
| 131 * patches. | 132 * patches. |
| 132 */ | 133 */ |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 super.addMember(element); | 493 super.addMember(element); |
| 493 } | 494 } |
| 494 } | 495 } |
| 495 | 496 |
| 496 // TODO(ahe): Get rid of this class. | 497 // TODO(ahe): Get rid of this class. |
| 497 class PatchMetadataAnnotation extends MetadataAnnotation { | 498 class PatchMetadataAnnotation extends MetadataAnnotation { |
| 498 final leg.Constant value = null; | 499 final leg.Constant value = null; |
| 499 | 500 |
| 500 PatchMetadataAnnotation() : super(STATE_DONE); | 501 PatchMetadataAnnotation() : super(STATE_DONE); |
| 501 } | 502 } |
| OLD | NEW |