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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 * element. | 112 * element. |
113 */ | 113 */ |
114 | 114 |
115 library patchparser; | 115 library patchparser; |
116 | 116 |
117 import 'dart:async'; | 117 import 'dart:async'; |
118 | 118 |
119 import 'constants/values.dart' show ConstantValue; | 119 import 'constants/values.dart' show ConstantValue; |
120 import 'dart2jslib.dart' | 120 import 'dart2jslib.dart' |
121 show Compiler, | 121 show Compiler, |
122 CompilerTask; | 122 CompilerTask, |
123 import 'diagnostic_listener.dart'; | 123 DiagnosticListener, |
| 124 MessageKind, |
| 125 Script; |
124 import 'elements/elements.dart'; | 126 import 'elements/elements.dart'; |
125 import 'elements/modelx.dart' | 127 import 'elements/modelx.dart' |
126 show BaseFunctionElementX, | 128 show BaseFunctionElementX, |
127 ClassElementX, | 129 ClassElementX, |
128 GetterElementX, | 130 GetterElementX, |
129 LibraryElementX, | 131 LibraryElementX, |
130 MetadataAnnotationX, | 132 MetadataAnnotationX, |
131 SetterElementX; | 133 SetterElementX; |
132 import 'messages.dart' show MessageKind; | |
133 import 'library_loader.dart' show LibraryLoader; | 134 import 'library_loader.dart' show LibraryLoader; |
134 import 'scanner/scannerlib.dart'; // Scanner, Parsers, Listeners | 135 import 'scanner/scannerlib.dart'; // Scanner, Parsers, Listeners |
135 import 'script.dart'; | |
136 import 'util/util.dart'; | 136 import 'util/util.dart'; |
137 | 137 |
138 class PatchParserTask extends CompilerTask { | 138 class PatchParserTask extends CompilerTask { |
139 final String name = "Patching Parser"; | 139 final String name = "Patching Parser"; |
140 | 140 |
141 PatchParserTask(Compiler compiler): super(compiler); | 141 PatchParserTask(Compiler compiler): super(compiler); |
142 | 142 |
143 /** | 143 /** |
144 * Scans a library patch file, applies the method patches and | 144 * Scans a library patch file, applies the method patches and |
145 * injections to the library, and returns a list of class | 145 * injections to the library, and returns a list of class |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 | 570 |
571 class PatchVersion { | 571 class PatchVersion { |
572 final String tag; | 572 final String tag; |
573 | 573 |
574 const PatchVersion(this.tag); | 574 const PatchVersion(this.tag); |
575 | 575 |
576 bool isActive(String patchTag) => tag == null || tag == patchTag; | 576 bool isActive(String patchTag) => tag == null || tag == patchTag; |
577 | 577 |
578 String toString() => 'PatchVersion($tag)'; | 578 String toString() => 'PatchVersion($tag)'; |
579 } | 579 } |
OLD | NEW |