Skip to content

Commit bfb3ead

Browse files
asgerfCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c23c3d9 commit bfb3ead

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

shared/yeast/src/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ impl<C: Clone> BuildCtx<'_, C> {
183183
///
184184
/// Use when descending into a subtree — a body, expression, or statement
185185
/// list — that must not inherit any of the surrounding translation
186-
/// context (for example an enclosing binding modifier). Accepts single
187-
/// (`Id`), optional (`Option<Id>`), and repeated (`Vec<Id>`) captures,
188-
/// since all of them are `IntoIterator<Item = Id>`.
186+
/// context (for example an enclosing binding modifier). Accepts optional
187+
/// (`Option<Id>`) and repeated (`Vec<Id>`) captures (both `IntoIterator`);
188+
/// for a single `Id`, wrap it in `std::iter::once(id)`.
189189
pub fn translate_reset<I: Into<Id>>(
190190
&mut self,
191191
ids: impl IntoIterator<Item = I>,

unified/ql/lib/codeql/unified/internal/AstExtra.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module Public {
4444
class Comment extends TriviaToken {
4545
// At the moment, comments are the only type trivia token we extract
4646
/**
47-
* Gets the text inside this comment, not counting the delimeters.
47+
* Gets the text inside this comment, not counting the delimiters.
4848
*/
4949
string getCommentText() {
5050
result = this.getValue().regexpCapture("//(.*)", 1)

unified/ql/lib/codeql/unified/internal/Variables.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ private module LocalNameBindingInput implements LocalNameBindingInputSig<Locatio
1212
private class LogicalAndRoot extends LogicalAndExpr {
1313
LogicalAndRoot() { not this = any(LogicalAndExpr e).getAnOperand() }
1414

15-
private Expr getDescendent(string path) {
15+
private Expr getDescendant(string path) {
1616
path = "" and result = this
1717
or
18-
exists(LogicalAndExpr mid, string midPath | mid = this.getDescendent(midPath) |
18+
exists(LogicalAndExpr mid, string midPath | mid = this.getDescendant(midPath) |
1919
result = mid.getLeft() and path = midPath + "A"
2020
or
2121
result = mid.getRight() and path = midPath + "B"
@@ -25,7 +25,7 @@ private module LocalNameBindingInput implements LocalNameBindingInputSig<Locatio
2525
Expr getNthLeaf(int n) {
2626
result =
2727
rank[n](Expr e, string path |
28-
e = this.getDescendent(path) and not e instanceof LogicalAndExpr
28+
e = this.getDescendant(path) and not e instanceof LogicalAndExpr
2929
|
3030
e order by path
3131
)

unified/ql/test/library-tests/variables/test.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func t27(opt: Int?) { // name=opt1
244244
func t28(a: Int?, b: Int?) {
245245
if let x = a, // $ access=a
246246
let y = b, // $ access=b
247-
x < y { // $ $ access=x access=y
247+
x < y { // $ access=x access=y
248248
print(x) // $ access=x
249249
print(y) // $ access=y
250250
}
@@ -273,7 +273,7 @@ func t30(opt: Int?) { // name=opt1
273273
func t31(a: Int?, b: Int?) {
274274
guard let x = a, // $ access=a
275275
let y = b, // $ access=b
276-
x < y else { // $ $ access=x access=y
276+
x < y else { // $ access=x access=y
277277
return
278278
}
279279
print(x) // $ access=x
@@ -303,7 +303,7 @@ func t34() {
303303
let x = 1 // name=x1
304304
if x > 0, // $ access=x1
305305
let x = x, // $ access=x1 // name=x2
306-
x > 0 else { // $ access=x2
306+
x > 0 { // $ access=x2
307307
print(x) // $ access=x2
308308
}
309309
}
@@ -319,7 +319,7 @@ func t35(optional: Int?) { // name=optional1
319319
func t36(a: Int?, b: Int?) {
320320
while let x = a, // $ access=a
321321
let y = b, // $ access=b
322-
x < y { // $ $ access=x access=y
322+
x < y { // $ access=x access=y
323323
print(x) // $ access=x
324324
print(y) // $ access=y
325325
}

0 commit comments

Comments
 (0)