forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenumdecl.ql
More file actions
25 lines (23 loc) · 807 Bytes
/
enumdecl.ql
File metadata and controls
25 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import swift
string describe(Decl d) {
d instanceof EnumDecl and result = "(EnumDecl)"
or
d instanceof EnumCaseDecl and result = "(EnumCaseDecl)"
or
d instanceof EnumElementDecl and result = "(EnumElementDecl)"
or
result = ".getType = " + d.(EnumDecl).getType().toString()
or
result = ".getDeclaringDecl = " + d.getDeclaringDecl().toString()
or
exists(int i |
result = ".getElement(" + i.toString() + ") = " + d.(EnumCaseDecl).getElement(i).toString()
or
result = ".getParam(" + i.toString() + ") = " + d.(EnumElementDecl).getParam(i).toString()
or
result = ".getEnumElement(" + i.toString() + ") = " + d.(EnumDecl).getEnumElement(i).toString()
)
}
from Decl d
where exists(d.getLocation().getFile().getRelativePath())
select d, strictconcat(describe(d), ", ")