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

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: Renamed Assert to assertHelper. Switched parser to use parseArguments. Added assert argument checki… 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/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 2c74e0cf351a864d5fbd59150fd0dcb6f14e1499..8e8dab55d6a7432d0061642f26f4a4670f19c605 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -436,6 +436,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.
*/
@@ -1695,6 +1698,13 @@ class NodeListener extends ElementListener {
beginToken, inKeyword));
}
+ void handleAssertStatement(Token assertKeyword, Token semicolonToken) {
+ NodeList arguments = popNode();
+ 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