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

Unified Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 725473005: During resolution, record the target of break/continue statements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: pkg/analyzer/lib/src/generated/ast.dart
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index 603635d5cb4eb6ed3f53457894b3b91658aec3ee..3e9237ac32364f90592884370ec4aecd42ab2f36 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -3855,6 +3855,17 @@ class BreakStatement extends Statement {
Token semicolon;
/**
+ * The AstNode which this break statement is breaking from. This will be
+ * either a Statement (in the case of breaking out of a loop) or a
+ * SwitchMember (in the case of a labeled break statement whose label matches
+ * a label on a switch case in an enclosing switch statement). Null if the
+ * AST has not yet been resolved or if the target could not be resolved.
+ * Note that if the source code has errors, the target may be invalid (e.g.
+ * trying to break to a switch case).
+ */
+ AstNode target;
+
+ /**
* Initialize a newly created break statement.
*
* @param keyword the token representing the 'break' keyword
@@ -6091,6 +6102,16 @@ class ContinueStatement extends Statement {
Token semicolon;
/**
+ * The AstNode which this continue statement is continuing to. This will be
+ * either a Statement (in the case of continuing a loop) or a SwitchMember
+ * (in the case of continuing from one switch case to another). Null if the
+ * AST has not yet been resolved or if the target could not be resolved.
+ * Note that if the source code has errors, the target may be invalid (e.g.
+ * the target may be in an enclosing function).
+ */
+ AstNode target;
+
+ /**
* Initialize a newly created continue statement.
*
* @param keyword the token representing the 'continue' keyword
@@ -7783,14 +7804,6 @@ class ForEachStatement extends Statement {
Expression get iterable => _iterable;
/**
- * Return the expression evaluated to produce the iterator.
- *
- * Deprecated, use [iterable] instead.
- */
- @deprecated
- Expression get iterator => iterable;
-
- /**
* Set the expression evaluated to produce the iterator to the given expression.
*
* @param expression the expression evaluated to produce the iterator
@@ -7800,6 +7813,14 @@ class ForEachStatement extends Statement {
}
/**
+ * Return the expression evaluated to produce the iterator.
+ *
+ * Deprecated, use [iterable] instead.
+ */
+ @deprecated
+ Expression get iterator => iterable;
+
+ /**
* Return the declaration of the loop variable, or `null` if the loop variable is a simple
* identifier.
*
@@ -11731,6 +11752,9 @@ class LabeledStatement extends Statement {
}
@override
+ Statement get unlabeled => _statement.unlabeled;
+
+ @override
accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
@override
@@ -17225,6 +17249,11 @@ abstract class SingleStringLiteral extends StringLiteral {
* </pre>
*/
abstract class Statement extends AstNode {
+ /**
+ * If this is a labeled statement, return the unlabeled portion of the
+ * statement. Otherwise return the statement itself.
+ */
+ Statement get unlabeled => this;
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | pkg/analyzer/lib/src/generated/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698