mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Merge pull request #214 from github/regexp_naming
Use RegExp prefix instead of Regex, for consistency with other languages.
This commit is contained in:
@@ -285,7 +285,7 @@ class StringInterpolationComponent extends StringComponent, StmtSequence,
|
||||
}
|
||||
|
||||
/**
|
||||
* A string, symbol, regex, or subshell literal.
|
||||
* A string, symbol, regexp, or subshell literal.
|
||||
*/
|
||||
class StringlikeLiteral extends Literal, TStringlikeLiteral {
|
||||
/**
|
||||
@@ -326,7 +326,7 @@ class StringlikeLiteral extends Literal, TStringlikeLiteral {
|
||||
this instanceof TStringLiteral and
|
||||
result = "\""
|
||||
or
|
||||
this instanceof TRegexLiteral and
|
||||
this instanceof TRegExpLiteral and
|
||||
result = "/"
|
||||
or
|
||||
this instanceof TSimpleSymbolLiteral and
|
||||
@@ -349,7 +349,7 @@ class StringlikeLiteral extends Literal, TStringlikeLiteral {
|
||||
this instanceof TStringLiteral and
|
||||
result = "\""
|
||||
or
|
||||
this instanceof TRegexLiteral and
|
||||
this instanceof TRegExpLiteral and
|
||||
result = "/"
|
||||
or
|
||||
this instanceof TSimpleSymbolLiteral and
|
||||
@@ -445,17 +445,17 @@ private class BareStringLiteral extends StringLiteral, TBareStringLiteral {
|
||||
* /[a-z]+/
|
||||
* ```
|
||||
*/
|
||||
class RegexLiteral extends StringlikeLiteral, TRegexLiteral {
|
||||
class RegExpLiteral extends StringlikeLiteral, TRegExpLiteral {
|
||||
private Generated::Regex g;
|
||||
|
||||
RegexLiteral() { this = TRegexLiteral(g) }
|
||||
RegExpLiteral() { this = TRegExpLiteral(g) }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "RegexLiteral" }
|
||||
final override string getAPrimaryQlClass() { result = "RegExpLiteral" }
|
||||
|
||||
final override StringComponent getComponent(int i) { toGenerated(result) = g.getChild(i) }
|
||||
|
||||
/**
|
||||
* Gets the regex flags as a string.
|
||||
* Gets the regexp flags as a string.
|
||||
*
|
||||
* ```rb
|
||||
* /foo/ # => ""
|
||||
@@ -474,7 +474,7 @@ class RegexLiteral extends StringlikeLiteral, TRegexLiteral {
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the regex was specified using the `i` flag to indicate case
|
||||
* Holds if the regexp was specified using the `i` flag to indicate case
|
||||
* insensitivity, as in the following example:
|
||||
*
|
||||
* ```rb
|
||||
|
||||
@@ -507,23 +507,23 @@ class SpaceshipExpr extends BinaryOperation, TSpaceshipExpr {
|
||||
}
|
||||
|
||||
/**
|
||||
* A regex match expression.
|
||||
* A regexp match expression.
|
||||
* ```rb
|
||||
* input =~ /\d/
|
||||
* ```
|
||||
*/
|
||||
class RegexMatchExpr extends BinaryOperation, TRegexMatchExpr {
|
||||
final override string getAPrimaryQlClass() { result = "RegexMatchExpr" }
|
||||
class RegExpMatchExpr extends BinaryOperation, TRegExpMatchExpr {
|
||||
final override string getAPrimaryQlClass() { result = "RegExpMatchExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A regex-doesn't-match expression.
|
||||
* A regexp-doesn't-match expression.
|
||||
* ```rb
|
||||
* input !~ /\d/
|
||||
* ```
|
||||
*/
|
||||
class NoRegexMatchExpr extends BinaryOperation, TNoRegexMatchExpr {
|
||||
final override string getAPrimaryQlClass() { result = "NoRegexMatchExpr" }
|
||||
class NoRegExpMatchExpr extends BinaryOperation, TNoRegExpMatchExpr {
|
||||
final override string getAPrimaryQlClass() { result = "NoRegExpMatchExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -191,7 +191,7 @@ private module Cached {
|
||||
TNEExpr(Generated::Binary g) { g instanceof @binary_bangequal } or
|
||||
TNextStmt(Generated::Next g) or
|
||||
TNilLiteral(Generated::Nil g) or
|
||||
TNoRegexMatchExpr(Generated::Binary g) { g instanceof @binary_bangtilde } or
|
||||
TNoRegExpMatchExpr(Generated::Binary g) { g instanceof @binary_bangtilde } or
|
||||
TNotExpr(Generated::Unary g) { g instanceof @unary_bang or g instanceof @unary_not } or
|
||||
TOptionalParameter(Generated::OptionalParameter g) or
|
||||
TPair(Generated::Pair g) or
|
||||
@@ -204,8 +204,8 @@ private module Cached {
|
||||
} or
|
||||
TRationalLiteral(Generated::Rational g) or
|
||||
TRedoStmt(Generated::Redo g) or
|
||||
TRegexLiteral(Generated::Regex g) or
|
||||
TRegexMatchExpr(Generated::Binary g) { g instanceof @binary_equaltilde } or
|
||||
TRegExpLiteral(Generated::Regex g) or
|
||||
TRegExpMatchExpr(Generated::Binary g) { g instanceof @binary_equaltilde } or
|
||||
TRegularArrayLiteral(Generated::Array g) or
|
||||
TRegularMethodCall(Generated::Call g) { isRegularMethodCall(g) } or
|
||||
TRegularStringLiteral(Generated::String g) or
|
||||
@@ -365,7 +365,7 @@ private module Cached {
|
||||
n = TNEExpr(result) or
|
||||
n = TNextStmt(result) or
|
||||
n = TNilLiteral(result) or
|
||||
n = TNoRegexMatchExpr(result) or
|
||||
n = TNoRegExpMatchExpr(result) or
|
||||
n = TNotExpr(result) or
|
||||
n = TOptionalParameter(result) or
|
||||
n = TPair(result) or
|
||||
@@ -374,8 +374,8 @@ private module Cached {
|
||||
n = TRangeLiteralReal(result) or
|
||||
n = TRationalLiteral(result) or
|
||||
n = TRedoStmt(result) or
|
||||
n = TRegexLiteral(result) or
|
||||
n = TRegexMatchExpr(result) or
|
||||
n = TRegExpLiteral(result) or
|
||||
n = TRegExpMatchExpr(result) or
|
||||
n = TRegularArrayLiteral(result) or
|
||||
n = TRegularMethodCall(result) or
|
||||
n = TRegularStringLiteral(result) or
|
||||
@@ -564,7 +564,7 @@ class TStringComponent =
|
||||
TStringTextComponent or TStringEscapeSequenceComponent or TStringInterpolationComponent;
|
||||
|
||||
class TStringlikeLiteral =
|
||||
TStringLiteral or TRegexLiteral or TSymbolLiteral or TSubshellLiteral or THereDoc;
|
||||
TStringLiteral or TRegExpLiteral or TSymbolLiteral or TSubshellLiteral or THereDoc;
|
||||
|
||||
class TStringLiteral = TRegularStringLiteral or TBareStringLiteral;
|
||||
|
||||
@@ -598,7 +598,7 @@ class TUnaryBitwiseOperation = TComplementExpr;
|
||||
|
||||
class TBinaryOperation =
|
||||
TBinaryArithmeticOperation or TBinaryLogicalOperation or TBinaryBitwiseOperation or
|
||||
TComparisonOperation or TSpaceshipExpr or TRegexMatchExpr or TNoRegexMatchExpr;
|
||||
TComparisonOperation or TSpaceshipExpr or TRegExpMatchExpr or TNoRegExpMatchExpr;
|
||||
|
||||
class TBinaryArithmeticOperation =
|
||||
TAddExpr or TSubExpr or TMulExpr or TDivExpr or TModuloExpr or TExponentExpr;
|
||||
|
||||
@@ -75,7 +75,7 @@ class HardcodedValueSource extends DataFlow::Node {
|
||||
* Gets a regular expression for matching names of locations (variables, parameters, keys) that
|
||||
* indicate the value being held is a credential.
|
||||
*/
|
||||
private string getACredentialRegex() {
|
||||
private string getACredentialRegExp() {
|
||||
result = "(?i).*pass(wd|word|code|phrase)(?!.*question).*" or
|
||||
result = "(?i).*(puid|username|userid).*" or
|
||||
result = "(?i).*(cert)(?!.*(format|name)).*"
|
||||
@@ -83,7 +83,7 @@ private string getACredentialRegex() {
|
||||
|
||||
bindingset[name]
|
||||
private predicate maybeCredentialName(string name) {
|
||||
name.regexpMatch(getACredentialRegex()) and
|
||||
name.regexpMatch(getACredentialRegExp()) and
|
||||
not name.suffix(name.length() - 4) = "file"
|
||||
}
|
||||
|
||||
|
||||
@@ -1151,43 +1151,43 @@ literals/literals.rb:
|
||||
# 129| getStmt: [SubExpr] ... - ...
|
||||
# 129| getAnOperand/getLeftOperand: [IntegerLiteral] 5
|
||||
# 129| getAnOperand/getRightOperand: [IntegerLiteral] 4
|
||||
# 132| getStmt: [RegexLiteral] //
|
||||
# 133| getStmt: [RegexLiteral] /foo/
|
||||
# 132| getStmt: [RegExpLiteral] //
|
||||
# 133| getStmt: [RegExpLiteral] /foo/
|
||||
# 133| getComponent: [StringTextComponent] foo
|
||||
# 134| getStmt: [RegexLiteral] /foo/
|
||||
# 134| getStmt: [RegExpLiteral] /foo/
|
||||
# 134| getComponent: [StringTextComponent] foo
|
||||
# 135| getStmt: [RegexLiteral] /foo+\sbar\S/
|
||||
# 135| getStmt: [RegExpLiteral] /foo+\sbar\S/
|
||||
# 135| getComponent: [StringTextComponent] foo+
|
||||
# 135| getComponent: [StringEscapeSequenceComponent] \s
|
||||
# 135| getComponent: [StringTextComponent] bar
|
||||
# 135| getComponent: [StringEscapeSequenceComponent] \S
|
||||
# 136| getStmt: [RegexLiteral] /foo#{...}bar/
|
||||
# 136| getStmt: [RegExpLiteral] /foo#{...}bar/
|
||||
# 136| getComponent: [StringTextComponent] foo
|
||||
# 136| getComponent: [StringInterpolationComponent] #{...}
|
||||
# 136| getStmt: [AddExpr] ... + ...
|
||||
# 136| getAnOperand/getLeftOperand: [IntegerLiteral] 1
|
||||
# 136| getAnOperand/getRightOperand: [IntegerLiteral] 1
|
||||
# 136| getComponent: [StringTextComponent] bar
|
||||
# 137| getStmt: [RegexLiteral] /foo/
|
||||
# 137| getStmt: [RegExpLiteral] /foo/
|
||||
# 137| getComponent: [StringTextComponent] foo
|
||||
# 138| getStmt: [RegexLiteral] //
|
||||
# 139| getStmt: [RegexLiteral] /foo/
|
||||
# 138| getStmt: [RegExpLiteral] //
|
||||
# 139| getStmt: [RegExpLiteral] /foo/
|
||||
# 139| getComponent: [StringTextComponent] foo
|
||||
# 140| getStmt: [RegexLiteral] /foo/
|
||||
# 140| getStmt: [RegExpLiteral] /foo/
|
||||
# 140| getComponent: [StringTextComponent] foo
|
||||
# 141| getStmt: [RegexLiteral] /foo+\sbar\S/
|
||||
# 141| getStmt: [RegExpLiteral] /foo+\sbar\S/
|
||||
# 141| getComponent: [StringTextComponent] foo+
|
||||
# 141| getComponent: [StringEscapeSequenceComponent] \s
|
||||
# 141| getComponent: [StringTextComponent] bar
|
||||
# 141| getComponent: [StringEscapeSequenceComponent] \S
|
||||
# 142| getStmt: [RegexLiteral] /foo#{...}bar/
|
||||
# 142| getStmt: [RegExpLiteral] /foo#{...}bar/
|
||||
# 142| getComponent: [StringTextComponent] foo
|
||||
# 142| getComponent: [StringInterpolationComponent] #{...}
|
||||
# 142| getStmt: [AddExpr] ... + ...
|
||||
# 142| getAnOperand/getLeftOperand: [IntegerLiteral] 1
|
||||
# 142| getAnOperand/getRightOperand: [IntegerLiteral] 1
|
||||
# 142| getComponent: [StringTextComponent] bar
|
||||
# 143| getStmt: [RegexLiteral] /foo/
|
||||
# 143| getStmt: [RegExpLiteral] /foo/
|
||||
# 143| getComponent: [StringTextComponent] foo
|
||||
# 146| getStmt: [StringLiteral] "abcdefghijklmnopqrstuvwxyzabcdef"
|
||||
# 146| getComponent: [StringTextComponent] abcdefghijklmnopqrstuvwxyzabcdef
|
||||
@@ -1704,13 +1704,13 @@ operations/operations.rb:
|
||||
# 64| getStmt: [SpaceshipExpr] ... <=> ...
|
||||
# 64| getAnOperand/getLeftOperand: [LocalVariableAccess] a
|
||||
# 64| getAnOperand/getRightOperand: [LocalVariableAccess] b
|
||||
# 65| getStmt: [RegexMatchExpr] ... =~ ...
|
||||
# 65| getStmt: [RegExpMatchExpr] ... =~ ...
|
||||
# 65| getAnOperand/getLeftOperand: [LocalVariableAccess] name
|
||||
# 65| getAnOperand/getRightOperand: [RegexLiteral] /foo.*/
|
||||
# 65| getAnOperand/getRightOperand: [RegExpLiteral] /foo.*/
|
||||
# 65| getComponent: [StringTextComponent] foo.*
|
||||
# 66| getStmt: [NoRegexMatchExpr] ... !~ ...
|
||||
# 66| getStmt: [NoRegExpMatchExpr] ... !~ ...
|
||||
# 66| getAnOperand/getLeftOperand: [LocalVariableAccess] handle
|
||||
# 66| getAnOperand/getRightOperand: [RegexLiteral] /.*bar/
|
||||
# 66| getAnOperand/getRightOperand: [RegExpLiteral] /.*bar/
|
||||
# 66| getComponent: [StringTextComponent] .*bar
|
||||
# 69| getStmt: [AssignAddExpr] ... += ...
|
||||
# 69| getAnOperand/getLeftOperand: [LocalVariableAccess] x
|
||||
|
||||
@@ -179,22 +179,22 @@ allLiterals
|
||||
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | <none> |
|
||||
| literals.rb:129:13:129:13 | 5 | IntegerLiteral | 5 |
|
||||
| literals.rb:129:17:129:17 | 4 | IntegerLiteral | 4 |
|
||||
| literals.rb:132:1:132:2 | // | RegexLiteral | |
|
||||
| literals.rb:133:1:133:5 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:134:1:134:6 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | foo+\\sbar\\S |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | <none> |
|
||||
| literals.rb:132:1:132:2 | // | RegExpLiteral | |
|
||||
| literals.rb:133:1:133:5 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:134:1:134:6 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | foo+\\sbar\\S |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | <none> |
|
||||
| literals.rb:136:8:136:8 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:136:12:136:12 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:137:1:137:8 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:138:1:138:4 | // | RegexLiteral | |
|
||||
| literals.rb:139:1:139:7 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:140:1:140:8 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | foo+\\sbar\\S |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | <none> |
|
||||
| literals.rb:137:1:137:8 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:138:1:138:4 | // | RegExpLiteral | |
|
||||
| literals.rb:139:1:139:7 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:140:1:140:8 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | foo+\\sbar\\S |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | <none> |
|
||||
| literals.rb:142:10:142:10 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:142:14:142:14 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:143:1:143:10 | /foo/ | RegexLiteral | foo |
|
||||
| literals.rb:143:1:143:10 | /foo/ | RegExpLiteral | foo |
|
||||
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | StringLiteral | abcdefghijklmnopqrstuvwxyzabcdef |
|
||||
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | StringLiteral | foobarfoobarfoobarfoobarfoobarfoo |
|
||||
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | StringLiteral | foobar\\\\foobar\\\\foobar\\\\foobar\\\\foobar |
|
||||
@@ -349,7 +349,7 @@ stringLiterals
|
||||
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | abcdefghijklmnopqrstuvwxyzabcdef |
|
||||
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | foobarfoobarfoobarfoobarfoobarfoo |
|
||||
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | foobar\\\\foobar\\\\foobar\\\\foobar\\\\foobar |
|
||||
regexLiterals
|
||||
regExpLiterals
|
||||
| literals.rb:132:1:132:2 | // | | |
|
||||
| literals.rb:133:1:133:5 | /foo/ | foo | |
|
||||
| literals.rb:134:1:134:6 | /foo/ | foo | i |
|
||||
@@ -482,26 +482,26 @@ stringComponents
|
||||
| literals.rb:128:1:128:18 | `du -d #{...}` | SubshellLiteral | 1 | literals.rb:128:8:128:17 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | 0 | literals.rb:129:4:129:9 | du -d | StringTextComponent |
|
||||
| literals.rb:129:1:129:20 | `du -d #{...}` | SubshellLiteral | 1 | literals.rb:129:10:129:19 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:133:1:133:5 | /foo/ | RegexLiteral | 0 | literals.rb:133:2:133:4 | foo | StringTextComponent |
|
||||
| literals.rb:134:1:134:6 | /foo/ | RegexLiteral | 0 | literals.rb:134:2:134:4 | foo | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 0 | literals.rb:135:2:135:5 | foo+ | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 1 | literals.rb:135:6:135:7 | \\s | StringEscapeSequenceComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 2 | literals.rb:135:8:135:10 | bar | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegexLiteral | 3 | literals.rb:135:11:135:12 | \\S | StringEscapeSequenceComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 0 | literals.rb:136:2:136:4 | foo | StringTextComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 1 | literals.rb:136:5:136:14 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegexLiteral | 2 | literals.rb:136:15:136:17 | bar | StringTextComponent |
|
||||
| literals.rb:137:1:137:8 | /foo/ | RegexLiteral | 0 | literals.rb:137:2:137:4 | foo | StringTextComponent |
|
||||
| literals.rb:139:1:139:7 | /foo/ | RegexLiteral | 0 | literals.rb:139:4:139:6 | foo | StringTextComponent |
|
||||
| literals.rb:140:1:140:8 | /foo/ | RegexLiteral | 0 | literals.rb:140:4:140:6 | foo | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 0 | literals.rb:141:4:141:7 | foo+ | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 1 | literals.rb:141:8:141:9 | \\s | StringEscapeSequenceComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 2 | literals.rb:141:10:141:12 | bar | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegexLiteral | 3 | literals.rb:141:13:141:14 | \\S | StringEscapeSequenceComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 0 | literals.rb:142:4:142:6 | foo | StringTextComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 1 | literals.rb:142:7:142:16 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegexLiteral | 2 | literals.rb:142:17:142:19 | bar | StringTextComponent |
|
||||
| literals.rb:143:1:143:10 | /foo/ | RegexLiteral | 0 | literals.rb:143:4:143:6 | foo | StringTextComponent |
|
||||
| literals.rb:133:1:133:5 | /foo/ | RegExpLiteral | 0 | literals.rb:133:2:133:4 | foo | StringTextComponent |
|
||||
| literals.rb:134:1:134:6 | /foo/ | RegExpLiteral | 0 | literals.rb:134:2:134:4 | foo | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 0 | literals.rb:135:2:135:5 | foo+ | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 1 | literals.rb:135:6:135:7 | \\s | StringEscapeSequenceComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 2 | literals.rb:135:8:135:10 | bar | StringTextComponent |
|
||||
| literals.rb:135:1:135:13 | /foo+\\sbar\\S/ | RegExpLiteral | 3 | literals.rb:135:11:135:12 | \\S | StringEscapeSequenceComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 0 | literals.rb:136:2:136:4 | foo | StringTextComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 1 | literals.rb:136:5:136:14 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:136:1:136:18 | /foo#{...}bar/ | RegExpLiteral | 2 | literals.rb:136:15:136:17 | bar | StringTextComponent |
|
||||
| literals.rb:137:1:137:8 | /foo/ | RegExpLiteral | 0 | literals.rb:137:2:137:4 | foo | StringTextComponent |
|
||||
| literals.rb:139:1:139:7 | /foo/ | RegExpLiteral | 0 | literals.rb:139:4:139:6 | foo | StringTextComponent |
|
||||
| literals.rb:140:1:140:8 | /foo/ | RegExpLiteral | 0 | literals.rb:140:4:140:6 | foo | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 0 | literals.rb:141:4:141:7 | foo+ | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 1 | literals.rb:141:8:141:9 | \\s | StringEscapeSequenceComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 2 | literals.rb:141:10:141:12 | bar | StringTextComponent |
|
||||
| literals.rb:141:1:141:15 | /foo+\\sbar\\S/ | RegExpLiteral | 3 | literals.rb:141:13:141:14 | \\S | StringEscapeSequenceComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 0 | literals.rb:142:4:142:6 | foo | StringTextComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 1 | literals.rb:142:7:142:16 | #{...} | StringInterpolationComponent |
|
||||
| literals.rb:142:1:142:20 | /foo#{...}bar/ | RegExpLiteral | 2 | literals.rb:142:17:142:19 | bar | StringTextComponent |
|
||||
| literals.rb:143:1:143:10 | /foo/ | RegExpLiteral | 0 | literals.rb:143:4:143:6 | foo | StringTextComponent |
|
||||
| literals.rb:146:1:146:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | StringLiteral | 0 | literals.rb:146:2:146:33 | abcdefghijklmnopqrstuvwxyzabcdef | StringTextComponent |
|
||||
| literals.rb:147:1:147:35 | "foobarfoobarfoobarfoobarfooba..." | StringLiteral | 0 | literals.rb:147:2:147:34 | foobarfoobarfoobarfoobarfoobarfoo | StringTextComponent |
|
||||
| literals.rb:148:1:148:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | StringLiteral | 0 | literals.rb:148:2:148:7 | foobar | StringTextComponent |
|
||||
|
||||
@@ -19,7 +19,7 @@ query predicate stringLiterals(StringLiteral l, string valueText) {
|
||||
stringlikeLiterals(l, valueText)
|
||||
}
|
||||
|
||||
query predicate regexLiterals(RegexLiteral l, string valueText, string flags) {
|
||||
query predicate regExpLiterals(RegExpLiteral l, string valueText, string flags) {
|
||||
stringlikeLiterals(l, valueText) and flags = l.getFlagString()
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ binaryOperations
|
||||
| operations.rb:60:1:60:5 | ... < ... | < | operations.rb:60:1:60:1 | a | operations.rb:60:5:60:5 | b | LTExpr |
|
||||
| operations.rb:61:1:61:8 | ... <= ... | <= | operations.rb:61:1:61:1 | 7 | operations.rb:61:6:61:8 | foo | LEExpr |
|
||||
| operations.rb:64:1:64:7 | ... <=> ... | <=> | operations.rb:64:1:64:1 | a | operations.rb:64:7:64:7 | b | SpaceshipExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | operations.rb:65:9:65:15 | /foo.*/ | RegexMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | operations.rb:66:11:66:17 | /.*bar/ | NoRegexMatchExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | operations.rb:65:9:65:15 | /foo.*/ | RegExpMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | operations.rb:66:11:66:17 | /.*bar/ | NoRegExpMatchExpr |
|
||||
| operations.rb:69:3:69:4 | ... + ... | + | operations.rb:69:1:69:1 | x | operations.rb:69:6:69:8 | 128 | AddExpr |
|
||||
| operations.rb:70:3:70:4 | ... - ... | - | operations.rb:70:1:70:1 | y | operations.rb:70:6:70:7 | 32 | SubExpr |
|
||||
| operations.rb:71:3:71:4 | ... * ... | * | operations.rb:71:1:71:1 | a | operations.rb:71:6:71:7 | 12 | MulExpr |
|
||||
@@ -93,7 +93,7 @@ relationalOperations
|
||||
| operations.rb:61:1:61:8 | ... <= ... | <= | operations.rb:61:1:61:1 | 7 | operations.rb:61:6:61:8 | foo | LEExpr |
|
||||
spaceshipExprs
|
||||
| operations.rb:64:1:64:7 | ... <=> ... | <=> | operations.rb:64:1:64:1 | a | operations.rb:64:7:64:7 | b | SpaceshipExpr |
|
||||
regexMatchExprs
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | operations.rb:65:9:65:15 | /foo.*/ | RegexMatchExpr |
|
||||
noRegexMatchExprs
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | operations.rb:66:11:66:17 | /.*bar/ | NoRegexMatchExpr |
|
||||
regExpMatchExprs
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | operations.rb:65:9:65:15 | /foo.*/ | RegExpMatchExpr |
|
||||
noRegExpMatchExprs
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | operations.rb:66:11:66:17 | /.*bar/ | NoRegExpMatchExpr |
|
||||
|
||||
@@ -54,14 +54,14 @@ query predicate spaceshipExprs(
|
||||
binaryOperations(e, operator, left, right, pClass)
|
||||
}
|
||||
|
||||
query predicate regexMatchExprs(
|
||||
RegexMatchExpr e, string operator, Expr left, Expr right, string pClass
|
||||
query predicate regExpMatchExprs(
|
||||
RegExpMatchExpr e, string operator, Expr left, Expr right, string pClass
|
||||
) {
|
||||
binaryOperations(e, operator, left, right, pClass)
|
||||
}
|
||||
|
||||
query predicate noRegexMatchExprs(
|
||||
NoRegexMatchExpr e, string operator, Expr left, Expr right, string pClass
|
||||
query predicate noRegExpMatchExprs(
|
||||
NoRegExpMatchExpr e, string operator, Expr left, Expr right, string pClass
|
||||
) {
|
||||
binaryOperations(e, operator, left, right, pClass)
|
||||
}
|
||||
|
||||
@@ -88,10 +88,10 @@
|
||||
| operations.rb:61:1:61:8 | ... <= ... | <= | operations.rb:61:6:61:8 | foo | LEExpr |
|
||||
| operations.rb:64:1:64:7 | ... <=> ... | <=> | operations.rb:64:1:64:1 | a | SpaceshipExpr |
|
||||
| operations.rb:64:1:64:7 | ... <=> ... | <=> | operations.rb:64:7:64:7 | b | SpaceshipExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | RegexMatchExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:9:65:15 | /foo.*/ | RegexMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | NoRegexMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:11:66:17 | /.*bar/ | NoRegexMatchExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:1:65:4 | name | RegExpMatchExpr |
|
||||
| operations.rb:65:1:65:15 | ... =~ ... | =~ | operations.rb:65:9:65:15 | /foo.*/ | RegExpMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:1:66:6 | handle | NoRegExpMatchExpr |
|
||||
| operations.rb:66:1:66:17 | ... !~ ... | !~ | operations.rb:66:11:66:17 | /.*bar/ | NoRegExpMatchExpr |
|
||||
| operations.rb:69:1:69:8 | ... += ... | += | operations.rb:69:1:69:1 | x | AssignAddExpr |
|
||||
| operations.rb:69:1:69:8 | ... += ... | += | operations.rb:69:6:69:8 | 128 | AssignAddExpr |
|
||||
| operations.rb:69:1:69:8 | ... = ... | = | operations.rb:69:1:69:1 | x | AssignExpr |
|
||||
|
||||
Reference in New Issue
Block a user