Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: dart/lib/compiler/implementation/patch_parser.dart

Issue 10911298: Parse new library syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: dart/lib/compiler/implementation/patch_parser.dart
diff --git a/dart/lib/compiler/implementation/patch_parser.dart b/dart/lib/compiler/implementation/patch_parser.dart
index cfc78f8531f9f1925856482c32bf1e7e5905a4b1..d96b205c3b876546ba1ec2ffd6b5f8cb99462c9b 100644
--- a/dart/lib/compiler/implementation/patch_parser.dart
+++ b/dart/lib/compiler/implementation/patch_parser.dart
@@ -26,7 +26,7 @@ class PatchParserTask extends leg.CompilerTask {
CompilationUnitElement compilationUnit =
new CompilationUnitElement(script, library);
library.addCompilationUnit(compilationUnit);
- LinkBuilder<tree.ScriptTag> imports = new LinkBuilder<tree.ScriptTag>();
+ LinkBuilder<tree.LibraryTag> imports = new LinkBuilder<tree.LibraryTag>();
compiler.withCurrentElement(compilationUnit, () {
// This patches the elements of the patch library into [library].
// Injected elements are added directly under the compilation unit.
@@ -36,14 +36,14 @@ class PatchParserTask extends leg.CompilerTask {
// After scanning declarations, we handle the import tags in the patch.
// TODO(lrn): These imports end up in the original library and are in
// scope for the original methods too. This should be fixed.
- for (tree.ScriptTag tag in imports.toLink()) {
+ for (tree.LibraryTag tag in imports.toLink()) {
compiler.scanner.importLibraryFromTag(tag, compilationUnit);
}
}
void scanLibraryElements(
CompilationUnitElement compilationUnit,
- LinkBuilder<tree.ScriptTag> imports) {
+ LinkBuilder<tree.LibraryTag> imports) {
measure(() {
// TODO(lrn): Possibly recursively handle #source directives in patch.
leg.Script script = compilationUnit.script;
@@ -155,7 +155,7 @@ class PatchClassElementParser extends PatchParser {
* Extension of [ElementListener] for parsing patch files.
*/
class PatchElementListener extends ElementListener implements PatchListener {
- final LinkBuilder<tree.ScriptTag> imports;
+ final LinkBuilder<tree.LibraryTag> imports;
bool isMemberPatch = false;
bool isClassPatch = false;
@@ -192,10 +192,10 @@ class PatchElementListener extends ElementListener implements PatchListener {
* Allow script tags (import only, the parser rejects the rest for now) in
* patch files. The import tags will be added to the library.
*/
- bool allowScriptTags() => true;
+ bool allowLibraryTags() => true;
- void addScriptTag(tree.ScriptTag tag) {
- super.addScriptTag(tag);
+ void addLibraryTag(tree.LibraryTag tag) {
+ super.addLibraryTag(tag);
imports.addLast(tag);
}

Powered by Google App Engine
This is Rietveld 408576698