Skip to content

Commit b890e2e

Browse files
committed
Swift: Use camelCase in KeyPathComponent predicates.
1 parent 64443df commit b890e2e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

swift/ql/lib/codeql/swift/elements/KeyPathComponent.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ class KeyPathComponent extends Generated::KeyPathComponent {
44
/**
55
* Property access like `.bar` in `\Foo.bar`.
66
*/
7-
predicate is_property() { getKind() = 3 }
7+
predicate isProperty() { getKind() = 3 }
88

99
/**
1010
* Array or dictionary subscript like `[1]` or `["a", "b"]`.
1111
*/
12-
predicate is_subscript() { getKind() = 4 }
12+
predicate isSubscript() { getKind() = 4 }
1313

1414
/**
1515
* Optional forcing `!`.
1616
*/
17-
predicate is_optional_forcing() { getKind() = 5 }
17+
predicate isOptionalForcing() { getKind() = 5 }
1818

1919
/**
2020
* Optional chaining `?`.
2121
*/
22-
predicate is_optional_chaining() { getKind() = 6 }
22+
predicate isOptionalChaining() { getKind() = 6 }
2323

2424
/**
2525
* Implicit optional wrapping component inserted by the compiler when an optional chain ends in a non-optional value.
2626
*/
27-
predicate is_optional_wrapping() { getKind() = 7 }
27+
predicate isOptionalWrapping() { getKind() = 7 }
2828

2929
/**
3030
* Reference to the entire object; the `self` in `\Foo.self`.
3131
*/
32-
predicate is_self() { getKind() = 8 }
32+
predicate isSelf() { getKind() = 8 }
3333

3434
/**
3535
* Tuple indexing like `.1`.
3636
*/
37-
predicate is_tuple_indexing() { getKind() = 9 }
37+
predicate isTupleIndexing() { getKind() = 9 }
3838
}

swift/ql/test/library-tests/elements/KeyPathComponent/KindAccessors.ql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ from
77
where
88
toBeTested(x) and
99
not x.isUnknown() and
10-
(if x.is_property() then property = "property" else property = "") and
11-
(if x.is_subscript() then subscript = "subscript" else subscript = "") and
12-
(if x.is_optional_forcing() then opt_forcing = "optional forcing" else opt_forcing = "") and
13-
(if x.is_optional_chaining() then opt_chaining = "optional chaining" else opt_chaining = "") and
14-
(if x.is_optional_wrapping() then opt_wrapping = "optional wrapping" else opt_wrapping = "") and
15-
(if x.is_self() then self = "self" else self = "") and
16-
if x.is_tuple_indexing() then tuple_indexing = "tuple indexing" else tuple_indexing = ""
10+
(if x.isProperty() then property = "property" else property = "") and
11+
(if x.isSubscript() then subscript = "subscript" else subscript = "") and
12+
(if x.isOptionalForcing() then opt_forcing = "optional forcing" else opt_forcing = "") and
13+
(if x.isOptionalChaining() then opt_chaining = "optional chaining" else opt_chaining = "") and
14+
(if x.isOptionalWrapping() then opt_wrapping = "optional wrapping" else opt_wrapping = "") and
15+
(if x.isSelf() then self = "self" else self = "") and
16+
if x.isTupleIndexing() then tuple_indexing = "tuple indexing" else tuple_indexing = ""
1717
select x, "getKind:", x.getKind(), property, subscript, opt_forcing, opt_chaining, opt_wrapping,
1818
self, tuple_indexing

0 commit comments

Comments
 (0)