@@ -64,6 +64,13 @@ class Stmt extends @stmt, ExprOrStmt, Documentable {
6464 }
6565}
6666
67+ private class TControlStmt =
68+ TLoopStmt or @ifstmt or @withstmt or @switchstmt or @trystmt or @catchclause;
69+
70+ private class TLoopStmt = TEnhancedForLoop or @whilestmt or @dowhilestmt or @forstmt;
71+
72+ private class TEnhancedForLoop = @forinstmt or @foreachstmt or @forofstmt;
73+
6774/**
6875 * A control statement, that is, is a loop, an if statement, a switch statement,
6976 * a with statement, a try statement, or a catch clause.
@@ -82,7 +89,7 @@ class Stmt extends @stmt, ExprOrStmt, Documentable {
8289 * }
8390 * ```
8491 */
85- abstract class ControlStmt extends Stmt {
92+ class ControlStmt extends TControlStmt , Stmt {
8693 /** Gets a statement controlled by this control statement. */
8794 abstract Stmt getAControlledStmt ( ) ;
8895}
@@ -102,7 +109,7 @@ abstract class ControlStmt extends Stmt {
102109 * } while(++i < lines.length);
103110 * ```
104111 */
105- abstract class LoopStmt extends ControlStmt {
112+ class LoopStmt extends TLoopStmt , ControlStmt {
106113 /** Gets the body of this loop. */
107114 abstract Stmt getBody ( ) ;
108115
@@ -450,6 +457,10 @@ class LabeledStmt extends @labeledstmt, Stmt {
450457 Stmt getStmt ( ) { result = getChildStmt ( 1 ) }
451458}
452459
460+ private class TJumpStmt = TBreakOrContinueStmt or @returnstmt or @throwstmt;
461+
462+ private class TBreakOrContinueStmt = @breakstmt or @continuestmt;
463+
453464/**
454465 * A statement that disrupts structured control flow, that is, a `continue` statement,
455466 * a `break` statement, a `throw` statement, or a `return` statement.
@@ -463,7 +474,7 @@ class LabeledStmt extends @labeledstmt, Stmt {
463474 * return -1;
464475 * ```
465476 */
466- abstract class JumpStmt extends Stmt {
477+ class JumpStmt extends TJumpStmt , Stmt {
467478 /**
468479 * Gets the target of this jump.
469480 *
@@ -490,7 +501,7 @@ abstract class JumpStmt extends Stmt {
490501 * break;
491502 * ```
492503 */
493- abstract class BreakOrContinueStmt extends JumpStmt {
504+ class BreakOrContinueStmt extends TBreakOrContinueStmt , JumpStmt {
494505 /** Gets the label this statement refers to, if any. */
495506 string getTargetLabel ( ) { result = getChildExpr ( 0 ) .( Identifier ) .getName ( ) }
496507
@@ -801,7 +812,7 @@ class ForStmt extends @forstmt, LoopStmt {
801812 * }
802813 * ```
803814 */
804- abstract class EnhancedForLoop extends LoopStmt {
815+ class EnhancedForLoop extends TEnhancedForLoop , LoopStmt {
805816 /**
806817 * Gets the iterator of this `for`-`in` or `for`-`of` loop; this can be either a
807818 * pattern, a property reference, or a variable declaration statement.
0 commit comments