File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
ql/lib/codeql/swift/elements/stmt Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,23 @@ class BraceStmt extends Generated::BraceStmt {
11
11
}
12
12
13
13
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
+ }
14
33
}
Original file line number Diff line number Diff line change @@ -935,6 +935,7 @@ class StmtCondition(AstNode):
935
935
elements : list [ConditionElement ] | child
936
936
937
937
class BraceStmt (Stmt ):
938
+ variables : list [VarDecl ] | child | doc ("variable declared in the scope of this brace statement" )
938
939
elements : list [AstNode ] | child
939
940
940
941
class BreakStmt (Stmt ):
You can’t perform that action at this time.
0 commit comments