Chromium Code Reviews| Index: pkg/kernel/lib/ast.dart |
| diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart |
| index f0d508fa304f7a54799b98ecc72f1f45b07abceb..a19135607034c111754c0a87da5f30bbb714c219 100644 |
| --- a/pkg/kernel/lib/ast.dart |
| +++ b/pkg/kernel/lib/ast.dart |
| @@ -3178,6 +3178,7 @@ class ClosureCreation extends Expression { |
| abstract class Statement extends TreeNode { |
| accept(StatementVisitor v); |
| accept1(StatementVisitor1 v, arg); |
| + bool get isLoop => false; |
|
Dmitry Stefantsov
2017/08/24 09:41:13
Personally, I don't like modifying AST definitions
sjindel
2017/08/24 11:11:43
I understand that, but I feel like determining whe
Dmitry Stefantsov
2017/08/24 11:49:57
I agree that it's a general operation and that it
sjindel
2017/08/24 14:50:13
Done.
|
| } |
| /// A statement with a compile-time error. |
| @@ -3363,6 +3364,8 @@ class WhileStatement extends Statement { |
| body?.parent = this; |
| } |
| } |
| + |
| + bool get isLoop => true; |
| } |
| class DoStatement extends Statement { |
| @@ -3392,6 +3395,8 @@ class DoStatement extends Statement { |
| condition?.parent = this; |
| } |
| } |
| + |
| + bool get isLoop => true; |
| } |
| class ForStatement extends Statement { |
| @@ -3429,6 +3434,8 @@ class ForStatement extends Statement { |
| body?.parent = this; |
| } |
| } |
| + |
| + bool get isLoop => true; |
| } |
| class ForInStatement extends Statement { |
| @@ -3473,6 +3480,8 @@ class ForInStatement extends Statement { |
| body?.parent = this; |
| } |
| } |
| + |
| + bool get isLoop => true; |
| } |
| /// Statement of form `switch (e) { case x: ... }`. |