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

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

Issue 11014010: Made assert a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 3298428766a661c10ad6f2cbe62d4ec997f1dd80..026c5ab009b468a2d58b90ed3a1a2987728e538b 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -406,6 +406,9 @@ class Listener {
void handleEmptyStatement(Token token) {
}
+ void handleAssertStatement(Token assertKeyword, Token semicolonToken) {
+ }
+
/** Called with either the token containing a double literal, or
* an immediately preceding "unary plus" token.
*/
@@ -1604,6 +1607,14 @@ class NodeListener extends ElementListener {
beginToken, inKeyword));
}
+ void handleAssertStatement(Token assertKeyword, Token semicolonToken) {
+ ParenthesizedExpression condition = popNode();
+ NodeList arguments = new NodeList.singleton(condition);
+ Node selector = new Identifier(assertKeyword);
+ Node send = new Send(null, selector, arguments);
+ pushNode(new ExpressionStatement(send, semicolonToken));
+ }
+
void endUnamedFunction(Token token) {
Statement body = popNode();
NodeList formals = popNode();

Powered by Google App Engine
This is Rietveld 408576698