recognize ranges without upper bounds

This commit is contained in:
Erik Krogh Kristensen
2021-11-11 14:20:08 +01:00
parent acaf294bee
commit 1a8b6d7414
6 changed files with 34 additions and 9 deletions

View File

@@ -550,7 +550,10 @@ private class EffectivelyPlus extends RegExpTerm {
EffectivelyPlus() {
this instanceof RegExpPlus
or
exists(RegExpRange range | range.getLowerBound() = 1 and range.getUpperBound() >= 30 |
exists(RegExpRange range |
range.getLowerBound() = 1 and
(range.getUpperBound() >= 30 or not exists(range.getUpperBound()))
|
this = range
)
}
@@ -564,7 +567,10 @@ private class EffectivelyStar extends RegExpTerm {
EffectivelyStar() {
this instanceof RegExpStar
or
exists(RegExpRange range | range.getLowerBound() = 0 and range.getUpperBound() >= 30 |
exists(RegExpRange range |
range.getLowerBound() = 0 and
(range.getUpperBound() >= 30 or not exists(range.getUpperBound()))
|
this = range
)
}