mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
Ruby: Add RegExpNonWordBoundary to RegExpTreeView
This commit is contained in:
@@ -581,6 +581,15 @@ class RegExpWordBoundary extends RegExpSpecialChar {
|
||||
RegExpWordBoundary() { this.getChar() = "\\b" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-word boundary, that is, a regular expression term of the form `\B`.
|
||||
*/
|
||||
class RegExpNonWordBoundary extends RegExpSpecialChar {
|
||||
RegExpNonWordBoundary() { this.getChar() = "\\B" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "RegExpNonWordBoundary" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A character class escape in a regular expression.
|
||||
* That is, an escaped character that denotes multiple characters.
|
||||
|
||||
@@ -266,11 +266,11 @@ regexp.rb:
|
||||
# 43| [RegExpSequence] \b!a\B
|
||||
#-----| 0 -> [RegExpSpecialChar] \b
|
||||
#-----| 1 -> [RegExpConstant, RegExpNormalChar] !a
|
||||
#-----| 2 -> [RegExpSpecialChar] \B
|
||||
#-----| 2 -> [RegExpNonWordBoundary] \B
|
||||
|
||||
# 43| [RegExpConstant, RegExpNormalChar] !a
|
||||
|
||||
# 43| [RegExpSpecialChar] \B
|
||||
# 43| [RegExpNonWordBoundary] \B
|
||||
|
||||
# 46| [RegExpGroup] (foo)
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] foo
|
||||
|
||||
@@ -108,7 +108,7 @@ term
|
||||
| regexp.rb:43:2:43:3 | \\b | RegExpSpecialChar |
|
||||
| regexp.rb:43:2:43:7 | \\b!a\\B | RegExpSequence |
|
||||
| regexp.rb:43:4:43:5 | !a | RegExpConstant,RegExpNormalChar |
|
||||
| regexp.rb:43:6:43:7 | \\B | RegExpSpecialChar |
|
||||
| regexp.rb:43:6:43:7 | \\B | RegExpNonWordBoundary |
|
||||
| regexp.rb:46:2:46:6 | (foo) | RegExpGroup |
|
||||
| regexp.rb:46:2:46:7 | (foo)* | RegExpStar |
|
||||
| regexp.rb:46:2:46:10 | (foo)*bar | RegExpSequence |
|
||||
|
||||
Reference in New Issue
Block a user