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

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

Issue 10392024: Add a "Label" Node around an Identifier that is being used as a label. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressede review comments. Created 8 years, 7 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 | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 31ad767753cac3e22daf6f088c830feb2bc25c88..74dd30f0dc1b51b65e5489840bdb8bc7bd995db5 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -162,10 +162,13 @@ class Listener {
Token extendsKeyword, Token endToken) {
}
+ void handleLabel(Token token) {
+ }
+
void beginLabeledStatement(Token token) {
}
- void endLabeledStatement(Token colon) {
+ void endLabeledStatement() {
}
void beginLiteralMapEntry(Token token) {
@@ -1355,7 +1358,7 @@ class NodeListener extends ElementListener {
Token firstToken, Token endToken) {
NodeList statements = makeNodeList(statementCount, null, null, null);
NodeList expressions = makeNodeList(expressionCount, null, null, null);
- Identifier label = null;
+ Label label = null;
if (labelToken !== null) {
label = popNode();
}
@@ -1431,10 +1434,15 @@ class NodeListener extends ElementListener {
pushNode(new Send(expression, new Operator(operathor), arguments));
}
- void endLabeledStatement(Token colon) {
+ void handleLabel(Token colon) {
+ Identifier name = popNode();
+ pushNode(new Label(name, colon));
+ }
+
+ void endLabeledStatement() {
Statement statement = popNode();
- Identifier label = popNode();
- pushNode(new LabeledStatement(label, colon, statement));
+ Label label = popNode();
+ pushNode(new LabeledStatement(label, statement));
}
void log(message) {
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698