File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 5
5
private import rust
6
6
private import codeql.rust.elements.internal.generated.ParentChild
7
7
8
- query predicate multipleToString ( Element e , string s ) {
9
- s = strictconcat ( e .toString ( ) , "," ) and
8
+ /**
9
+ * Holds if `e` has more than one `toString()` result.
10
+ */
11
+ query predicate multipleToStrings ( Element e , string s ) {
12
+ s = strictconcat ( e .toString ( ) , ", " ) and
10
13
strictcount ( e .toString ( ) ) > 1
11
14
}
12
15
16
+ /**
17
+ * Holds if `e` has more than one `Location`.
18
+ */
13
19
query predicate multipleLocations ( Locatable e ) { strictcount ( e .getLocation ( ) ) > 1 }
14
20
21
+ /**
22
+ * Holds if `e` has more than one `getPrimaryQlClasses()` result.
23
+ */
15
24
query predicate multiplePrimaryQlClasses ( Element e , string s ) {
16
- s = e .getPrimaryQlClasses ( ) and
25
+ s = strictconcat ( e .getPrimaryQlClasses ( ) , ", " ) and
17
26
strictcount ( e .getAPrimaryQlClass ( ) ) > 1
18
27
}
19
28
20
29
private Element getParent ( Element child ) { child = getChildAndAccessor ( result , _, _) }
21
30
31
+ /**
32
+ * Holds if `child` has more than one AST parent.
33
+ */
22
34
query predicate multipleParents ( Element child , Element parent ) {
23
35
parent = getParent ( child ) and
24
36
strictcount ( getParent ( child ) ) > 1
You can’t perform that action at this time.
0 commit comments