Skip to content

Commit 3a9ffe1

Browse files
authored
Merge pull request #14567 from github/redsun82/swift-case-variables
Swift: clean up `VarDecl`, `NamedPattern` and `SwitchStmt` interactions
2 parents c4521a3 + 9e2f0b5 commit 3a9ffe1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+13850
-396
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Change the second column in named_patterns from a @var_decl to a string
2+
class NamedPattern extends @named_pattern {
3+
VarDecl getVarDecl() { named_patterns(this, result) }
4+
5+
string toString() { none() }
6+
}
7+
8+
class VarDecl extends @var_decl {
9+
string getName() { var_decls(this, result, _) }
10+
11+
string toString() { none() }
12+
}
13+
14+
from NamedPattern np, VarDecl d, string name
15+
where d = np.getVarDecl() and name = d.getName()
16+
select np, name

0 commit comments

Comments
 (0)