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

Unified Diff: lib/compiler/implementation/tools/mini_parser.dart

Issue 10891022: Update corelib/ and lib/ to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « lib/compiler/implementation/scanner/scanner_task.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tools/mini_parser.dart
diff --git a/lib/compiler/implementation/tools/mini_parser.dart b/lib/compiler/implementation/tools/mini_parser.dart
index 3a36b45aaf4eceb39526c0886d93ef15018c40dc..cb39b2c1e925fd4d537ef6c6ab0de7c862f92add 100644
--- a/lib/compiler/implementation/tools/mini_parser.dart
+++ b/lib/compiler/implementation/tools/mini_parser.dart
@@ -99,15 +99,15 @@ void parseFile(String filename, MyOptions options) {
try {
Token token = scan(file);
if (!options.scanOnly) parser.parseUnit(token);
- } catch (ParserError ex) {
+ } on ParserError catch (ex) {
if (options.throwOnError) {
throw;
} else {
print(ex);
}
- } catch (MalformedInputException ex) {
+ } on MalformedInputException catch (ex) {
// Already diagnosed.
- } catch (var ex) {
+ } catch (ex) {
print('Error in file: $filename');
throw;
}
@@ -126,7 +126,7 @@ Token scan(MySourceFile source) {
Scanner scanner = new ByteArrayScanner(source.rawText);
try {
return scanner.tokenize();
- } catch (MalformedInputException ex) {
+ } on MalformedInputException catch (ex) {
if (ex.position is Token) {
print(formatError(ex.message, ex.position, ex.position, source));
} else {
@@ -144,7 +144,7 @@ void parseFilesFrom(InputStream input, MyOptions options, Function whenDone) {
stopwatch.start();
try {
parseFile(line, options);
- } catch (var ex, var trace) {
+ } catch (ex, trace) {
filesWithCrashes.add(line);
print(ex);
print(trace);
@@ -180,7 +180,7 @@ List<int> read(String filename) {
} finally {
try {
file.closeSync();
- } catch (var ex) {
+ } catch (ex) {
if (!threw) throw;
}
}
« no previous file with comments | « lib/compiler/implementation/scanner/scanner_task.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698