Python: make test for unicode names pass

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-05-14 07:31:03 +02:00
parent de50aabd60
commit c7ddd2c20c

View File

@@ -128,7 +128,7 @@ abstract class RegexString extends Expr {
private predicate singleEscape(int i) {
exists(string c |
c = this.getChar(i) and
c != "x" and c != "U"
c != "x" and c != "U" and c!= "N"
)
}
@@ -143,6 +143,16 @@ abstract class RegexString extends Expr {
or
this.getChar(start + 1) = "U" and end = start + 10
or
this.getChar(start + 1) = "N" and
this.getChar(start + 2) = "{" and
this.getChar(end - 1) = "}" and
end > start and
not exists(int i |
i > start + 2 and
i < end - 1 and
this.getChar(i) = "}"
)
or
this.singleEscape(start + 1) and end = start + 2
)
}