Skip to content

Commit ea1503c

Browse files
committed
fix ql-for-ql errors inside ql-for-ql
1 parent 83aaeca commit ea1503c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class ClasslessPredicate extends TClasslessPredicate, Predicate, ModuleDeclarati
415415
ClasslessPredicate() { this = TClasslessPredicate(pred) }
416416

417417
/**
418-
* If this predicate is an alias, gets the aliased value.
418+
* Gets the aliased value if this predicate is an alias
419419
* E.g. for `predicate foo = Module::bar/2;` gets `Module::bar/2`.
420420
* The result is either a `PredicateExpr` or `HigherOrderFormula`.
421421
*/
@@ -1672,7 +1672,7 @@ class Rank extends Aggregate {
16721672
override string getAPrimaryQlClass() { result = "Rank" }
16731673

16741674
/**
1675-
* The `i` in `rank[i]( | | )`.
1675+
* Gets the `i` in `rank[i]( | | )`.
16761676
*/
16771677
Expr getRankExpr() { toQL(result) = this.getAggregate().getChild(1) }
16781678

ql/ql/src/ide-contextual-queries/printAst.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import codeql_ql.printAstAst
1313
import codeql.IDEContextual
1414

1515
/**
16-
* The source file to generate an AST from.
16+
* Gets the source file to generate an AST from.
1717
*/
1818
external string selectedSourceFile();
1919

ql/ql/src/queries/style/RegexpInsteadOfPattern.ql

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ import ql
1313
* Gets a regular expression pattern that matches the syntax of likely regular expressions.
1414
*/
1515
private string getALikelyRegExpPattern() {
16-
result = "/.*/[gimuy]{1,5}" or // pattern with at least one flag: /foo/i
17-
result = "/\\^.*/[gimuy]{0,5}" or // pattern with anchor: /^foo/
18-
result = "/.*\\$/[gimuy]{0,5}" or // pattern with anchor: /foo$/
19-
result = "\\^.*\\$" or // pattern body with anchors: ^foo$
20-
result = ".*(?<!\\\\)\\\\[dDwWsSB].*" or // contains a builtin character class: \s
21-
result = ".*(?<!\\\\)\\\\[\\[\\]()*+?{}|^$.].*" or // contains an escaped meta-character: \(
22-
result = ".*\\[\\^?[\\p{Alnum}\\p{Blank}_-]+\\][*+].*" // contains a quantified custom character class: [^a-zA-Z123]+
16+
result =
17+
[
18+
"/.*/[gimuy]{1,5}", // pattern with at least one flag: /foo/i
19+
"/\\^.*/[gimuy]{0,5}", // pattern with anchor: /^foo/
20+
"/.*\\$/[gimuy]{0,5}", // pattern with anchor: /foo$/
21+
"\\^.*\\$", // pattern body with anchors: ^foo$
22+
".*(?<!\\\\)\\\\[dDwWsSB].*", // contains a builtin character class: \s
23+
".*(?<!\\\\)\\\\[\\[\\]()*+?{}|^$.].*", // contains an escaped meta-character: \(
24+
".*\\[\\^?[\\p{Alnum}\\p{Blank}_-]+\\][*+].*" // contains a quantified custom character class: [^a-zA-Z123]+
25+
]
2326
}
2427

2528
predicate isMatchesCall(MemberCall c) { c.getMemberName() = "matches" }

0 commit comments

Comments
 (0)