@@ -186,12 +186,7 @@ private predicate isCanonicalTerm(RelevantRegExpTerm term, string str) {
186
186
*/
187
187
string getCanonicalizationFlags ( RegExpTerm root ) {
188
188
root .isRootTerm ( ) and
189
- (
190
- if RegExpFlags:: isIgnoreCase ( root ) then
191
- result = "i"
192
- else
193
- result = ""
194
- )
189
+ ( if RegExpFlags:: isIgnoreCase ( root ) then result = "i" else result = "" )
195
190
}
196
191
197
192
/**
@@ -324,16 +319,16 @@ private module CharacterClasses {
324
319
if RegExpFlags:: isIgnoreCase ( cc .getRootTerm ( ) )
325
320
then
326
321
// normalize everything to lower case if the regexp is case insensitive
327
- exists ( string c | hasChildThatMatchesIgnoringCasing ( cc , c ) | char = c .toLowerCase ( ) )
328
- else hasChildThatMatchesIgnoringCasing ( cc , char )
322
+ exists ( string c | hasChildThatMatchesIgnoringCasingFlags ( cc , c ) | char = c .toLowerCase ( ) )
323
+ else hasChildThatMatchesIgnoringCasingFlags ( cc , char )
329
324
}
330
325
331
326
/**
332
327
* Holds if the character class `cc` has a child (constant or range) that matches `char`.
333
- * Ignores whether the character class is inside a regular expression that ignores casing .
328
+ * Ignores whether the character class is inside a regular expression that has the ignore case flag .
334
329
*/
335
330
pragma [ noinline]
336
- predicate hasChildThatMatchesIgnoringCasing ( RegExpCharacterClass cc , string char ) {
331
+ predicate hasChildThatMatchesIgnoringCasingFlags ( RegExpCharacterClass cc , string char ) {
337
332
exists ( getCanonicalCharClass ( cc ) ) and
338
333
exists ( RegExpTerm child | child = cc .getAChild ( ) |
339
334
char = child .( RegexpCharacterConstant ) .getValue ( )
0 commit comments