BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
661 stars 267 forks source link

#2235: allow literal dash at the end of a character group #2239

Closed GuntherRademacher closed 10 months ago

GuntherRademacher commented 10 months ago

As pointed out in #2235, a literal dash is not accepted at the end of a character class. This should be allowed, because according to XML Schema Part 2,

The - character is a valid character range only at the beginning or end of a ·positive character group·.

This fix extends the lookahead that distinguishes a character range from a single character in order to handle this. Basically it changes only regex.jj and adds tests to FnModuleTest.java, the remainder of the changes is code that was generated by JavaCC 7.0.10. There is a number of deviations from the old code that was generated by some earlier version, so it might make sense to run the XQuery test suite on it.

ChristianGruen commented 10 months ago

Excellent; that was quick. I’ll open a follow-up issue if I encounter problems with the existing QT4 test cases.