Ruby: Add RegExpNonWordBoundary to RegExpTreeView

This commit is contained in:
Harry Maclean
2022-03-28 17:04:31 +13:00
parent e3c3c00c68
commit 3f8b27c0cd
3 changed files with 12 additions and 3 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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 |