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

Unified Diff: dart/frog/leg/scanner/scanner_task.dart

Issue 9283031: Build script tags. (Closed) Base URL: ssh://aaricia.aar/home/ahe/Dart/all/dart.googlecode.com.git@script
Patch Set: Address review comments Created 8 years, 11 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
« no previous file with comments | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/leg/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/scanner_task.dart
diff --git a/dart/frog/leg/scanner/scanner_task.dart b/dart/frog/leg/scanner/scanner_task.dart
index a15056d515e8aa17d20ba154eb17c66e4e533227..e4eb832a3cf0378b3707d9fc8b76c8706b2b3174 100644
--- a/dart/frog/leg/scanner/scanner_task.dart
+++ b/dart/frog/leg/scanner/scanner_task.dart
@@ -8,20 +8,17 @@ class ScannerTask extends CompilerTask {
void scan(CompilationUnitElement compilationUnit) {
measure(() {
- Link<Element> elements = scanElements(compilationUnit);
- for (Link<Element> link = elements; !link.isEmpty(); link = link.tail) {
- Element existing = compiler.universe.find(link.head.name);
- if (existing !== null) {
- Node node = link.head.parseNode(compiler, compiler);
- // TODO(ahe): Is this the right place to handle this?
- compiler.cancel('Duplicate definition', node: node);
- }
- compiler.universe.define(link.head);
+ scanElements(compilationUnit);
+ for (Element element in compilationUnit.topLevelElements) {
+ compiler.universe.define(element, compiler);
+ }
+ for (ScriptTag tag in compilationUnit.tags) {
+ compiler.reportWarning(tag, "library tags are not implemented");
}
});
}
- Link<Element> scanElements(CompilationUnitElement compilationUnit) {
+ void scanElements(CompilationUnitElement compilationUnit) {
Script script = compilationUnit.script;
Token tokens;
try {
@@ -40,6 +37,5 @@ class ScannerTask extends CompilerTask {
ElementListener listener = new ElementListener(compiler, compilationUnit);
PartialParser parser = new PartialParser(listener);
parser.parseUnit(tokens);
- return listener.topLevelElements;
}
}
« no previous file with comments | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/leg/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698