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

Unified Diff: dart/lib/compiler/implementation/scanner/scanner_task.dart

Issue 10441014: Parameterize WorkItem.run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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/scanner/scanner_task.dart
diff --git a/dart/lib/compiler/implementation/scanner/scanner_task.dart b/dart/lib/compiler/implementation/scanner/scanner_task.dart
index 208db232f407eb015ae13f24fe02291ef01bddc0..620b67855ebab8921a4505679eb8945c1106a6d1 100644
--- a/dart/lib/compiler/implementation/scanner/scanner_task.dart
+++ b/dart/lib/compiler/implementation/scanner/scanner_task.dart
@@ -91,26 +91,19 @@ class ScannerTask extends CompilerTask {
Script script = compilationUnit.script;
Token tokens;
try {
- try {
- tokens = new StringScanner(script.text).tokenize();
- } catch (MalformedInputException ex) {
- Token token;
- var message;
- if (ex.position is num) {
- // TODO(ahe): Always use tokens in MalformedInputException.
- token = new Token(EOF_INFO, ex.position);
- } else {
- token = ex.position;
- }
- compiler.cancel(ex.message, token: token);
+ tokens = new StringScanner(script.text).tokenize();
+ } catch (MalformedInputException ex) {
+ Token token;
+ var message;
+ if (ex.position is num) {
+ // TODO(ahe): Always use tokens in MalformedInputException.
+ token = new Token(EOF_INFO, ex.position);
+ } else {
+ token = ex.position;
}
- compiler.dietParser.dietParse(compilationUnit, tokens);
- } catch (CompilerCancelledException ex) {
- throw;
- } catch (var ex) {
- compiler.unhandledExceptionOnElement(compilationUnit);
- throw;
+ compiler.cancel(ex.message, token: token);
}
+ compiler.dietParser.dietParse(compilationUnit, tokens);
}
LibraryElement loadLibrary(Uri uri, Node node) {
@@ -124,8 +117,10 @@ class ScannerTask extends CompilerTask {
return element;
});
if (newLibrary) {
- compiler.withCurrentElement(library, () => scan(library));
- compiler.onLibraryLoaded(library, uri);
+ compiler.withCurrentElement(library, () {
+ scan(library);
+ compiler.onLibraryLoaded(library, uri);
+ });
}
return library;
}
« dart/frog/tests/leg/compiler_helper.dart ('K') | « dart/lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698