File tree Expand file tree Collapse file tree
ql/lib/codeql/swift/elements/stmt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,4 +11,23 @@ class BraceStmt extends Generated::BraceStmt {
1111 }
1212
1313 override string toString ( ) { result = "{ ... }" }
14+
15+ override AstNode getImmediateElement ( int index ) {
16+ result =
17+ rank [ index + 1 ] ( AstNode element , int i |
18+ element = super .getImmediateElement ( i ) and
19+ not element instanceof VarDecl
20+ |
21+ element order by i
22+ )
23+ }
24+
25+ override VarDecl getVariable ( int index ) {
26+ result =
27+ rank [ index + 1 ] ( VarDecl variable , int i |
28+ variable = super .getImmediateElement ( i )
29+ |
30+ variable order by i
31+ )
32+ }
1433}
Original file line number Diff line number Diff line change @@ -935,6 +935,7 @@ class StmtCondition(AstNode):
935935 elements : list [ConditionElement ] | child
936936
937937class BraceStmt (Stmt ):
938+ variables : list [VarDecl ] | child | doc ("variable declared in the scope of this brace statement" )
938939 elements : list [AstNode ] | child
939940
940941class BreakStmt (Stmt ):
You can’t perform that action at this time.
0 commit comments