mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
rename hasChildThatMatchesIgnoringCasing to hasChildThatMatchesIgnoringCasingFlags
This commit is contained in:
@@ -186,12 +186,7 @@ private predicate isCanonicalTerm(RelevantRegExpTerm term, string str) {
|
||||
*/
|
||||
string getCanonicalizationFlags(RegExpTerm root) {
|
||||
root.isRootTerm() and
|
||||
(
|
||||
if RegExpFlags::isIgnoreCase(root) then
|
||||
result = "i"
|
||||
else
|
||||
result = ""
|
||||
)
|
||||
(if RegExpFlags::isIgnoreCase(root) then result = "i" else result = "")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,16 +319,16 @@ private module CharacterClasses {
|
||||
if RegExpFlags::isIgnoreCase(cc.getRootTerm())
|
||||
then
|
||||
// normalize everything to lower case if the regexp is case insensitive
|
||||
exists(string c | hasChildThatMatchesIgnoringCasing(cc, c) | char = c.toLowerCase())
|
||||
else hasChildThatMatchesIgnoringCasing(cc, char)
|
||||
exists(string c | hasChildThatMatchesIgnoringCasingFlags(cc, c) | char = c.toLowerCase())
|
||||
else hasChildThatMatchesIgnoringCasingFlags(cc, char)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the character class `cc` has a child (constant or range) that matches `char`.
|
||||
* Ignores whether the character class is inside a regular expression that ignores casing.
|
||||
* Ignores whether the character class is inside a regular expression that has the ignore case flag.
|
||||
*/
|
||||
pragma[noinline]
|
||||
predicate hasChildThatMatchesIgnoringCasing(RegExpCharacterClass cc, string char) {
|
||||
predicate hasChildThatMatchesIgnoringCasingFlags(RegExpCharacterClass cc, string char) {
|
||||
exists(getCanonicalCharClass(cc)) and
|
||||
exists(RegExpTerm child | child = cc.getAChild() |
|
||||
char = child.(RegexpCharacterConstant).getValue()
|
||||
|
||||
Reference in New Issue
Block a user