Skip to content

Commit 65aa97c

Browse files
committed
Use RegExp prefix instead of Regex, for consistency with other languages.
1 parent 78db1bf commit 65aa97c

10 files changed

Lines changed: 88 additions & 88 deletions

File tree

ql/src/codeql_ruby/ast/Literal.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class StringInterpolationComponent extends StringComponent, StmtSequence,
285285
}
286286

287287
/**
288-
* A string, symbol, regex, or subshell literal.
288+
* A string, symbol, regexp, or subshell literal.
289289
*/
290290
class StringlikeLiteral extends Literal, TStringlikeLiteral {
291291
/**
@@ -326,7 +326,7 @@ class StringlikeLiteral extends Literal, TStringlikeLiteral {
326326
this instanceof TStringLiteral and
327327
result = "\""
328328
or
329-
this instanceof TRegexLiteral and
329+
this instanceof TRegExpLiteral and
330330
result = "/"
331331
or
332332
this instanceof TSimpleSymbolLiteral and
@@ -349,7 +349,7 @@ class StringlikeLiteral extends Literal, TStringlikeLiteral {
349349
this instanceof TStringLiteral and
350350
result = "\""
351351
or
352-
this instanceof TRegexLiteral and
352+
this instanceof TRegExpLiteral and
353353
result = "/"
354354
or
355355
this instanceof TSimpleSymbolLiteral and
@@ -445,17 +445,17 @@ private class BareStringLiteral extends StringLiteral, TBareStringLiteral {
445445
* /[a-z]+/
446446
* ```
447447
*/
448-
class RegexLiteral extends StringlikeLiteral, TRegexLiteral {
448+
class RegExpLiteral extends StringlikeLiteral, TRegExpLiteral {
449449
private Generated::Regex g;
450450

451-
RegexLiteral() { this = TRegexLiteral(g) }
451+
RegExpLiteral() { this = TRegExpLiteral(g) }
452452

453-
final override string getAPrimaryQlClass() { result = "RegexLiteral" }
453+
final override string getAPrimaryQlClass() { result = "RegExpLiteral" }
454454

455455
final override StringComponent getComponent(int i) { toGenerated(result) = g.getChild(i) }
456456

457457
/**
458-
* Gets the regex flags as a string.
458+
* Gets the regexp flags as a string.
459459
*
460460
* ```rb
461461
* /foo/ # => ""
@@ -474,7 +474,7 @@ class RegexLiteral extends StringlikeLiteral, TRegexLiteral {
474474
}
475475

476476
/**
477-
* Holds if the regex was specified using the `i` flag to indicate case
477+
* Holds if the regexp was specified using the `i` flag to indicate case
478478
* insensitivity, as in the following example:
479479
*
480480
* ```rb

ql/src/codeql_ruby/ast/Operation.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,23 +507,23 @@ class SpaceshipExpr extends BinaryOperation, TSpaceshipExpr {
507507
}
508508

509509
/**
510-
* A regex match expression.
510+
* A regexp match expression.
511511
* ```rb
512512
* input =~ /\d/
513513
* ```
514514
*/
515-
class RegexMatchExpr extends BinaryOperation, TRegexMatchExpr {
516-
final override string getAPrimaryQlClass() { result = "RegexMatchExpr" }
515+
class RegExpMatchExpr extends BinaryOperation, TRegExpMatchExpr {
516+
final override string getAPrimaryQlClass() { result = "RegExpMatchExpr" }
517517
}
518518

519519
/**
520-
* A regex-doesn't-match expression.
520+
* A regexp-doesn't-match expression.
521521
* ```rb
522522
* input !~ /\d/
523523
* ```
524524
*/
525-
class NoRegexMatchExpr extends BinaryOperation, TNoRegexMatchExpr {
526-
final override string getAPrimaryQlClass() { result = "NoRegexMatchExpr" }
525+
class NoRegExpMatchExpr extends BinaryOperation, TNoRegExpMatchExpr {
526+
final override string getAPrimaryQlClass() { result = "NoRegExpMatchExpr" }
527527
}
528528

529529
/**

ql/src/codeql_ruby/ast/internal/AST.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private module Cached {
191191
TNEExpr(Generated::Binary g) { g instanceof @binary_bangequal } or
192192
TNextStmt(Generated::Next g) or
193193
TNilLiteral(Generated::Nil g) or
194-
TNoRegexMatchExpr(Generated::Binary g) { g instanceof @binary_bangtilde } or
194+
TNoRegExpMatchExpr(Generated::Binary g) { g instanceof @binary_bangtilde } or
195195
TNotExpr(Generated::Unary g) { g instanceof @unary_bang or g instanceof @unary_not } or
196196
TOptionalParameter(Generated::OptionalParameter g) or
197197
TPair(Generated::Pair g) or
@@ -204,8 +204,8 @@ private module Cached {
204204
} or
205205
TRationalLiteral(Generated::Rational g) or
206206
TRedoStmt(Generated::Redo g) or
207-
TRegexLiteral(Generated::Regex g) or
208-
TRegexMatchExpr(Generated::Binary g) { g instanceof @binary_equaltilde } or
207+
TRegExpLiteral(Generated::Regex g) or
208+
TRegExpMatchExpr(Generated::Binary g) { g instanceof @binary_equaltilde } or
209209
TRegularArrayLiteral(Generated::Array g) or
210210
TRegularMethodCall(Generated::Call g) { isRegularMethodCall(g) } or
211211
TRegularStringLiteral(Generated::String g) or
@@ -365,7 +365,7 @@ private module Cached {
365365
n = TNEExpr(result) or
366366
n = TNextStmt(result) or
367367
n = TNilLiteral(result) or
368-
n = TNoRegexMatchExpr(result) or
368+
n = TNoRegExpMatchExpr(result) or
369369
n = TNotExpr(result) or
370370
n = TOptionalParameter(result) or
371371
n = TPair(result) or
@@ -374,8 +374,8 @@ private module Cached {
374374
n = TRangeLiteralReal(result) or
375375
n = TRationalLiteral(result) or
376376
n = TRedoStmt(result) or
377-
n = TRegexLiteral(result) or
378-
n = TRegexMatchExpr(result) or
377+
n = TRegExpLiteral(result) or
378+
n = TRegExpMatchExpr(result) or
379379
n = TRegularArrayLiteral(result) or
380380
n = TRegularMethodCall(result) or
381381
n = TRegularStringLiteral(result) or
@@ -564,7 +564,7 @@ class TStringComponent =
564564
TStringTextComponent or TStringEscapeSequenceComponent or TStringInterpolationComponent;
565565

566566
class TStringlikeLiteral =
567-
TStringLiteral or TRegexLiteral or TSymbolLiteral or TSubshellLiteral or THereDoc;
567+
TStringLiteral or TRegExpLiteral or TSymbolLiteral or TSubshellLiteral or THereDoc;
568568

569569
class TStringLiteral = TRegularStringLiteral or TBareStringLiteral;
570570

@@ -598,7 +598,7 @@ class TUnaryBitwiseOperation = TComplementExpr;
598598

599599
class TBinaryOperation =
600600
TBinaryArithmeticOperation or TBinaryLogicalOperation or TBinaryBitwiseOperation or
601-
TComparisonOperation or TSpaceshipExpr or TRegexMatchExpr or TNoRegexMatchExpr;
601+
TComparisonOperation or TSpaceshipExpr or TRegExpMatchExpr or TNoRegExpMatchExpr;
602602

603603
class TBinaryArithmeticOperation =
604604
TAddExpr or TSubExpr or TMulExpr or TDivExpr or TModuloExpr or TExponentExpr;

ql/src/queries/security/cwe-798/HardcodedCredentials.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ class HardcodedValueSource extends DataFlow::Node {
7575
* Gets a regular expression for matching names of locations (variables, parameters, keys) that
7676
* indicate the value being held is a credential.
7777
*/
78-
private string getACredentialRegex() {
78+
private string getACredentialRegExp() {
7979
result = "(?i).*pass(wd|word|code|phrase)(?!.*question).*" or
8080
result = "(?i).*(puid|username|userid).*" or
8181
result = "(?i).*(cert)(?!.*(format|name)).*"
8282
}
8383

8484
bindingset[name]
8585
private predicate maybeCredentialName(string name) {
86-
name.regexpMatch(getACredentialRegex()) and
86+
name.regexpMatch(getACredentialRegExp()) and
8787
not name.suffix(name.length() - 4) = "file"
8888
}
8989

ql/test/library-tests/ast/Ast.expected

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,43 +1151,43 @@ literals/literals.rb:
11511151
# 129| getStmt: [SubExpr] ... - ...
11521152
# 129| getAnOperand/getLeftOperand: [IntegerLiteral] 5
11531153
# 129| getAnOperand/getRightOperand: [IntegerLiteral] 4
1154-
# 132| getStmt: [RegexLiteral] //
1155-
# 133| getStmt: [RegexLiteral] /foo/
1154+
# 132| getStmt: [RegExpLiteral] //
1155+
# 133| getStmt: [RegExpLiteral] /foo/
11561156
# 133| getComponent: [StringTextComponent] foo
1157-
# 134| getStmt: [RegexLiteral] /foo/
1157+
# 134| getStmt: [RegExpLiteral] /foo/
11581158
# 134| getComponent: [StringTextComponent] foo
1159-
# 135| getStmt: [RegexLiteral] /foo+\sbar\S/
1159+
# 135| getStmt: [RegExpLiteral] /foo+\sbar\S/
11601160
# 135| getComponent: [StringTextComponent] foo+
11611161
# 135| getComponent: [StringEscapeSequenceComponent] \s
11621162
# 135| getComponent: [StringTextComponent] bar
11631163
# 135| getComponent: [StringEscapeSequenceComponent] \S
1164-
# 136| getStmt: [RegexLiteral] /foo#{...}bar/
1164+
# 136| getStmt: [RegExpLiteral] /foo#{...}bar/
11651165
# 136| getComponent: [StringTextComponent] foo
11661166
# 136| getComponent: [StringInterpolationComponent] #{...}
11671167
# 136| getStmt: [AddExpr] ... + ...
11681168
# 136| getAnOperand/getLeftOperand: [IntegerLiteral] 1
11691169
# 136| getAnOperand/getRightOperand: [IntegerLiteral] 1
11701170
# 136| getComponent: [StringTextComponent] bar
1171-
# 137| getStmt: [RegexLiteral] /foo/
1171+
# 137| getStmt: [RegExpLiteral] /foo/
11721172
# 137| getComponent: [StringTextComponent] foo
1173-
# 138| getStmt: [RegexLiteral] //
1174-
# 139| getStmt: [RegexLiteral] /foo/
1173+
# 138| getStmt: [RegExpLiteral] //
1174+
# 139| getStmt: [RegExpLiteral] /foo/
11751175
# 139| getComponent: [StringTextComponent] foo
1176-
# 140| getStmt: [RegexLiteral] /foo/
1176+
# 140| getStmt: [RegExpLiteral] /foo/
11771177
# 140| getComponent: [StringTextComponent] foo
1178-
# 141| getStmt: [RegexLiteral] /foo+\sbar\S/
1178+
# 141| getStmt: [RegExpLiteral] /foo+\sbar\S/
11791179
# 141| getComponent: [StringTextComponent] foo+
11801180
# 141| getComponent: [StringEscapeSequenceComponent] \s
11811181
# 141| getComponent: [StringTextComponent] bar
11821182
# 141| getComponent: [StringEscapeSequenceComponent] \S
1183-
# 142| getStmt: [RegexLiteral] /foo#{...}bar/
1183+
# 142| getStmt: [RegExpLiteral] /foo#{...}bar/
11841184
# 142| getComponent: [StringTextComponent] foo
11851185
# 142| getComponent: [StringInterpolationComponent] #{...}
11861186
# 142| getStmt: [AddExpr] ... + ...
11871187
# 142| getAnOperand/getLeftOperand: [IntegerLiteral] 1
11881188
# 142| getAnOperand/getRightOperand: [IntegerLiteral] 1
11891189
# 142| getComponent: [StringTextComponent] bar
1190-
# 143| getStmt: [RegexLiteral] /foo/
1190+
# 143| getStmt: [RegExpLiteral] /foo/
11911191
# 143| getComponent: [StringTextComponent] foo
11921192
# 146| getStmt: [StringLiteral] "abcdefghijklmnopqrstuvwxyzabcdef"
11931193
# 146| getComponent: [StringTextComponent] abcdefghijklmnopqrstuvwxyzabcdef
@@ -1704,13 +1704,13 @@ operations/operations.rb:
17041704
# 64| getStmt: [SpaceshipExpr] ... <=> ...
17051705
# 64| getAnOperand/getLeftOperand: [LocalVariableAccess] a
17061706
# 64| getAnOperand/getRightOperand: [LocalVariableAccess] b
1707-
# 65| getStmt: [RegexMatchExpr] ... =~ ...
1707+
# 65| getStmt: [RegExpMatchExpr] ... =~ ...
17081708
# 65| getAnOperand/getLeftOperand: [LocalVariableAccess] name
1709-
# 65| getAnOperand/getRightOperand: [RegexLiteral] /foo.*/
1709+
# 65| getAnOperand/getRightOperand: [RegExpLiteral] /foo.*/
17101710
# 65| getComponent: [StringTextComponent] foo.*
1711-
# 66| getStmt: [NoRegexMatchExpr] ... !~ ...
1711+
# 66| getStmt: [NoRegExpMatchExpr] ... !~ ...
17121712
# 66| getAnOperand/getLeftOperand: [LocalVariableAccess] handle
1713-
# 66| getAnOperand/getRightOperand: [RegexLiteral] /.*bar/
1713+
# 66| getAnOperand/getRightOperand: [RegExpLiteral] /.*bar/
17141714
# 66| getComponent: [StringTextComponent] .*bar
17151715
# 69| getStmt: [AssignAddExpr] ... += ...
17161716
# 69| getAnOperand/getLeftOperand: [LocalVariableAccess] x

ql/test/library-tests/ast/literals/literals.expected

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,22 @@ allLiterals
179179
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | <none> |
180180
| literals.rb:129:13:129:13 | 5 | IntegerLiteral | 5 |
181181
| literals.rb:129:17:129:17 | 4 | IntegerLiteral | 4 |
182-
| literals.rb:132:1:132:2 | // | RegexLiteral | |
183-
| literals.rb:133:1:133:5 | /foo/ | RegexLiteral | foo |
184-
| literals.rb:134:1:134:6 | /foo/ | RegexLiteral | foo |
185-
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | foo+\\sbar\\S |
186-
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | <none> |
182+
| literals.rb:132:1:132:2 | // | RegExpLiteral | |
183+
| literals.rb:133:1:133:5 | /foo/ | RegExpLiteral | foo |
184+
| literals.rb:134:1:134:6 | /foo/ | RegExpLiteral | foo |
185+
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | foo+\\sbar\\S |
186+
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | <none> |
187187
| literals.rb:136:8:136:8 | 1 | IntegerLiteral | 1 |
188188
| literals.rb:136:12:136:12 | 1 | IntegerLiteral | 1 |
189-
| literals.rb:137:1:137:8 | /foo/ | RegexLiteral | foo |
190-
| literals.rb:138:1:138:4 | // | RegexLiteral | |
191-
| literals.rb:139:1:139:7 | /foo/ | RegexLiteral | foo |
192-
| literals.rb:140:1:140:8 | /foo/ | RegexLiteral | foo |
193-
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | foo+\\sbar\\S |
194-
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | <none> |
189+
| literals.rb:137:1:137:8 | /foo/ | RegExpLiteral | foo |
190+
| literals.rb:138:1:138:4 | // | RegExpLiteral | |
191+
| literals.rb:139:1:139:7 | /foo/ | RegExpLiteral | foo |
192+
| literals.rb:140:1:140:8 | /foo/ | RegExpLiteral | foo |
193+
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | foo+\\sbar\\S |
194+
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | <none> |
195195
| literals.rb:142:10:142:10 | 1 | IntegerLiteral | 1 |
196196
| literals.rb:142:14:142:14 | 1 | IntegerLiteral | 1 |
197-
| literals.rb:143:1:143:10 | /foo/ | RegexLiteral | foo |
197+
| literals.rb:143:1:143:10 | /foo/ | RegExpLiteral | foo |
198198
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | StringLiteral | abcdefghijklmnopqrstuvwxyzabcdef |
199199
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | StringLiteral | foobarfoobarfoobarfoobarfoobarfoo |
200200
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | StringLiteral | foobar\\\\foobar\\\\foobar\\\\foobar\\\\foobar |
@@ -349,7 +349,7 @@ stringLiterals
349349
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | abcdefghijklmnopqrstuvwxyzabcdef |
350350
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | foobarfoobarfoobarfoobarfoobarfoo |
351351
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | foobar\\\\foobar\\\\foobar\\\\foobar\\\\foobar |
352-
regexLiterals
352+
regExpLiterals
353353
| literals.rb:132:1:132:2 | // | | |
354354
| literals.rb:133:1:133:5 | /foo/ | foo | |
355355
| literals.rb:134:1:134:6 | /foo/ | foo | i |
@@ -482,26 +482,26 @@ stringComponents
482482
| literals.rb:128:1:128:18 | `du -d #{...}` | SubshellLiteral | 1 | literals.rb:128:8:128:17 | #{...} | StringInterpolationComponent |
483483
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | 0 | literals.rb:129:4:129:9 | du -d | StringTextComponent |
484484
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | 1 | literals.rb:129:10:129:19 | #{...} | StringInterpolationComponent |
485-
| literals.rb:133:1:133:5 | /foo/ | RegexLiteral | 0 | literals.rb:133:2:133:4 | foo | StringTextComponent |
486-
| literals.rb:134:1:134:6 | /foo/ | RegexLiteral | 0 | literals.rb:134:2:134:4 | foo | StringTextComponent |
487-
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 0 | literals.rb:135:2:135:5 | foo+ | StringTextComponent |
488-
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 1 | literals.rb:135:6:135:7 | \\s | StringEscapeSequenceComponent |
489-
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 2 | literals.rb:135:8:135:10 | bar | StringTextComponent |
490-
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 3 | literals.rb:135:11:135:12 | \\S | StringEscapeSequenceComponent |
491-
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 0 | literals.rb:136:2:136:4 | foo | StringTextComponent |
492-
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 1 | literals.rb:136:5:136:14 | #{...} | StringInterpolationComponent |
493-
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 2 | literals.rb:136:15:136:17 | bar | StringTextComponent |
494-
| literals.rb:137:1:137:8 | /foo/ | RegexLiteral | 0 | literals.rb:137:2:137:4 | foo | StringTextComponent |
495-
| literals.rb:139:1:139:7 | /foo/ | RegexLiteral | 0 | literals.rb:139:4:139:6 | foo | StringTextComponent |
496-
| literals.rb:140:1:140:8 | /foo/ | RegexLiteral | 0 | literals.rb:140:4:140:6 | foo | StringTextComponent |
497-
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 0 | literals.rb:141:4:141:7 | foo+ | StringTextComponent |
498-
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 1 | literals.rb:141:8:141:9 | \\s | StringEscapeSequenceComponent |
499-
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 2 | literals.rb:141:10:141:12 | bar | StringTextComponent |
500-
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 3 | literals.rb:141:13:141:14 | \\S | StringEscapeSequenceComponent |
501-
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 0 | literals.rb:142:4:142:6 | foo | StringTextComponent |
502-
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 1 | literals.rb:142:7:142:16 | #{...} | StringInterpolationComponent |
503-
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 2 | literals.rb:142:17:142:19 | bar | StringTextComponent |
504-
| literals.rb:143:1:143:10 | /foo/ | RegexLiteral | 0 | literals.rb:143:4:143:6 | foo | StringTextComponent |
485+
| literals.rb:133:1:133:5 | /foo/ | RegExpLiteral | 0 | literals.rb:133:2:133:4 | foo | StringTextComponent |
486+
| literals.rb:134:1:134:6 | /foo/ | RegExpLiteral | 0 | literals.rb:134:2:134:4 | foo | StringTextComponent |
487+
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 0 | literals.rb:135:2:135:5 | foo+ | StringTextComponent |
488+
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 1 | literals.rb:135:6:135:7 | \\s | StringEscapeSequenceComponent |
489+
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 2 | literals.rb:135:8:135:10 | bar | StringTextComponent |
490+
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 3 | literals.rb:135:11:135:12 | \\S | StringEscapeSequenceComponent |
491+
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 0 | literals.rb:136:2:136:4 | foo | StringTextComponent |
492+
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 1 | literals.rb:136:5:136:14 | #{...} | StringInterpolationComponent |
493+
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 2 | literals.rb:136:15:136:17 | bar | StringTextComponent |
494+
| literals.rb:137:1:137:8 | /foo/ | RegExpLiteral | 0 | literals.rb:137:2:137:4 | foo | StringTextComponent |
495+
| literals.rb:139:1:139:7 | /foo/ | RegExpLiteral | 0 | literals.rb:139:4:139:6 | foo | StringTextComponent |
496+
| literals.rb:140:1:140:8 | /foo/ | RegExpLiteral | 0 | literals.rb:140:4:140:6 | foo | StringTextComponent |
497+
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 0 | literals.rb:141:4:141:7 | foo+ | StringTextComponent |
498+
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 1 | literals.rb:141:8:141:9 | \\s | StringEscapeSequenceComponent |
499+
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 2 | literals.rb:141:10:141:12 | bar | StringTextComponent |
500+
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 3 | literals.rb:141:13:141:14 | \\S | StringEscapeSequenceComponent |
501+
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 0 | literals.rb:142:4:142:6 | foo | StringTextComponent |
502+
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 1 | literals.rb:142:7:142:16 | #{...} | StringInterpolationComponent |
503+
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 2 | literals.rb:142:17:142:19 | bar | StringTextComponent |
504+
| literals.rb:143:1:143:10 | /foo/ | RegExpLiteral | 0 | literals.rb:143:4:143:6 | foo | StringTextComponent |
505505
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | StringLiteral | 0 | literals.rb:146:2:146:33 | abcdefghijklmnopqrstuvwxyzabcdef | StringTextComponent |
506506
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | StringLiteral | 0 | literals.rb:147:2:147:34 | foobarfoobarfoobarfoobarfoobarfoo | StringTextComponent |
507507
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | StringLiteral | 0 | literals.rb:148:2:148:7 | foobar | StringTextComponent |

ql/test/library-tests/ast/literals/literals.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ query predicate stringLiterals(StringLiteral l, string valueText) {
1919
stringlikeLiterals(l, valueText)
2020
}
2121

22-
query predicate regexLiterals(RegexLiteral l, string valueText, string flags) {
22+
query predicate regExpLiterals(RegExpLiteral l, string valueText, string flags) {
2323
stringlikeLiterals(l, valueText) and flags = l.getFlagString()
2424
}
2525

0 commit comments

Comments
 (0)