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

Unified Diff: utils/css/parser.dart

Issue 10887023: Use new try-catch syntax in runtime/, tools/, and utils/. (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 | « utils/css/css.dart ('k') | utils/css/uitest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/css/parser.dart
diff --git a/utils/css/parser.dart b/utils/css/parser.dart
index 4cd7b977c828c0a63c2e53e26782dae4f4ec1a33..1d3230042a59f3e9596d79b2a1aa245d685338bf 100644
--- a/utils/css/parser.dart
+++ b/utils/css/parser.dart
@@ -129,7 +129,7 @@ class Parser {
var message;
try {
message = 'expected $expected, but found $tok';
- } catch (final e) {
+ } catch (e) {
message = 'parsing error expected $expected';
}
_error(message, tok.span);
@@ -757,7 +757,7 @@ class Parser {
try {
int hexValue = parseHex(hexText);
return new HexColorTerm(hexValue, hexText, _makeSpan(start));
- } catch (HexNumberException hne) {
+ } on HexNumberException catch (hne) {
_error('Bad hex number', _makeSpan(start));
}
break;
@@ -783,7 +783,7 @@ class Parser {
var term = processTerm();
if (term != null && term is LiteralTerm) {
group.add(term);
- }
+ }
} while (!_maybeEat(TokenKind.RPAREN));
return group;
@@ -820,11 +820,11 @@ class Parser {
String rgbColor = TokenKind.decimalToHex(colorValue, 3);
try {
colorValue = parseHex(rgbColor);
- } catch (HexNumberException hne) {
+ } on HexNumberException catch (hne) {
_error('Bad hex number', _makeSpan(start));
}
return new HexColorTerm(colorValue, rgbColor, _makeSpan(start));
- } catch (final error) {
+ } catch (error) {
if (error is NoColorMatchException) {
// TODO(terry): Other named things to match with validator?
« no previous file with comments | « utils/css/css.dart ('k') | utils/css/uitest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698