mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
Make \h and \H character class escapes
This commit is contained in:
@@ -399,12 +399,7 @@ class RegExpEscape extends RegExpNormalChar {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
class RegExpCharacterClassEscape extends RegExpEscape {
|
class RegExpCharacterClassEscape extends RegExpEscape {
|
||||||
// string value;
|
RegExpCharacterClassEscape() { this.getValue() in ["d", "D", "s", "S", "w", "W", "h", "H"] }
|
||||||
RegExpCharacterClassEscape() {
|
|
||||||
// value = re.getText().substring(start + 1, end) and
|
|
||||||
// value in ["d", "D", "s", "S", "w", "W"]
|
|
||||||
this.getValue() in ["d", "D", "s", "S", "w", "W"]
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Gets the name of the character class; for example, `w` for `\w`. */
|
/** Gets the name of the character class; for example, `w` for `\w`. */
|
||||||
// override string getValue() { result = value }
|
// override string getValue() { result = value }
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ regexp.rb:
|
|||||||
|
|
||||||
# 33| [RegExpCharacterClassEscape] \d
|
# 33| [RegExpCharacterClassEscape] \d
|
||||||
|
|
||||||
# 34| [RegExpConstant, RegExpEscape] \h
|
# 34| [RegExpCharacterClassEscape] \h
|
||||||
|
|
||||||
# 37| [RegExpConstant, RegExpNormalChar] f
|
# 37| [RegExpConstant, RegExpNormalChar] f
|
||||||
|
|
||||||
@@ -291,8 +291,8 @@ regexp.rb:
|
|||||||
#-----| 1 -> [RegExpCharacterClassEscape] \D
|
#-----| 1 -> [RegExpCharacterClassEscape] \D
|
||||||
|
|
||||||
# 34| [RegExpSequence] \h\H
|
# 34| [RegExpSequence] \h\H
|
||||||
#-----| 0 -> [RegExpConstant, RegExpEscape] \h
|
#-----| 0 -> [RegExpCharacterClassEscape] \h
|
||||||
#-----| 1 -> [RegExpConstant, RegExpEscape] \H
|
#-----| 1 -> [RegExpCharacterClassEscape] \H
|
||||||
|
|
||||||
# 37| [RegExpSequence] (foo)*bar
|
# 37| [RegExpSequence] (foo)*bar
|
||||||
#-----| 0 -> [RegExpStar] (foo)*
|
#-----| 0 -> [RegExpStar] (foo)*
|
||||||
@@ -388,7 +388,7 @@ regexp.rb:
|
|||||||
|
|
||||||
# 33| [RegExpCharacterClassEscape] \D
|
# 33| [RegExpCharacterClassEscape] \D
|
||||||
|
|
||||||
# 34| [RegExpConstant, RegExpEscape] \H
|
# 34| [RegExpCharacterClassEscape] \H
|
||||||
|
|
||||||
# 37| [RegExpConstant, RegExpNormalChar] o
|
# 37| [RegExpConstant, RegExpNormalChar] o
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user