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

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

Issue 11014010: Made assert a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed grammar. Created 8 years, 2 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: lib/compiler/implementation/scanner/parser.dart
diff --git a/lib/compiler/implementation/scanner/parser.dart b/lib/compiler/implementation/scanner/parser.dart
index b2faf1a83e517f1e19e9451db7c4197170e4a1f0..a276ebe35de96216d1b6e693104990ae97489a6b 100644
--- a/lib/compiler/implementation/scanner/parser.dart
+++ b/lib/compiler/implementation/scanner/parser.dart
@@ -1149,6 +1149,8 @@ class Parser {
return parseBreakStatement(token);
} else if (value === 'continue') {
return parseContinueStatement(token);
+ } else if (value === 'assert') {
+ return parseAssertStatement(token);
} else if (value === ';') {
return parseEmptyStatement(token);
} else if (value === 'const') {
@@ -2130,6 +2132,14 @@ class Parser {
return expectSemicolon(token);
}
+ Token parseAssertStatement(Token token) {
+ Token assertKeyword = token;
+ token = expect('assert', token);
+ token = parseArguments(token);
+ listener.handleAssertStatement(assertKeyword, token);
+ return expectSemicolon(token);
+ }
+
Token parseContinueStatement(Token token) {
assert(optional('continue', token));
Token continueKeyword = token;
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698