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

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

Issue 10540048: Implement 'as' operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: No entries in language.status, vm and dartc already implemented 'as'. Created 8 years, 6 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 982540d1bd90149b549e60248ad02a29b49722b9..6c9c41a652bbad603197f2a299f03e75e81de961 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -305,6 +305,10 @@ class Listener {
void endWhileStatement(Token whileKeyword, Token endToken) {
}
+ void handleAsOperator(Token operathor, Token endToken) {
+ // TODO(ahe): Rename [operathor] to "operator" when VM bug is fixed.
+ }
+
void handleAssignmentExpression(Token token) {
}
@@ -1055,6 +1059,13 @@ class NodeListener extends ElementListener {
pushNode(new Cascade(popNode()));
}
+ void handleAsOperator(Token operathor, Token endToken) {
+ TypeAnnotation type = popNode();
+ Expression expression = popNode();
+ NodeList arguments = new NodeList.singleton(type);
+ pushNode(new Send(expression, new Operator(operathor), arguments));
+ }
+
void handleAssignmentExpression(Token token) {
Node arg = popNode();
Node node = popNode();

Powered by Google App Engine
This is Rietveld 408576698