Python: Remove implied inequalities

Also gets rid of `inner_end`, since we're already doing `end - 1 = ...`
in the other fix (and so this is more consistent).
This commit is contained in:
Taus
2022-02-04 12:43:43 +00:00
committed by GitHub
parent 22aa4c9379
commit 67be20f368

View File

@@ -198,13 +198,11 @@ abstract class RegexString extends Expr {
/** Whether there is a character class, between start (inclusive) and end (exclusive) */
predicate charSet(int start, int end) {
exists(int inner_start, int inner_end |
exists(int inner_start |
this.char_set_start(start, inner_start) and
not this.char_set_start(_, start)
|
end = inner_end + 1 and
inner_end > inner_start and
inner_end = min(int i | this.nonEscapedCharAt(i) = "]" and inner_start < i)
end - 1 = min(int i | this.nonEscapedCharAt(i) = "]" and inner_start < i)
)
}
@@ -343,7 +341,6 @@ abstract class RegexString extends Expr {
this.escapingChar(start) and
this.getChar(start + 1) = "N" and
this.getChar(start + 2) = "{" and
end > start and
end - 1 = min(int i | start + 2 < i and this.getChar(i) = "}")
}