Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character set disagreements #4

Closed
rossabaker opened this issue Jun 17, 2022 · 2 comments
Closed

Character set disagreements #4

rossabaker opened this issue Jun 17, 2022 · 2 comments

Comments

@rossabaker
Copy link
Member

From #1:

failing seed for GeneratorsCheck.generates xml is 2vlpy64yIOKuEnqKnWrPi2mnlyiIXmu-8aZUOMf2qcL=
[info] ! GeneratorsCheck.generates xml: Exception raised on property evaluation.
[info] > Exception: java.lang.IllegalArgumentException: ʾ館뭆焲뭓鄹 must be an XML Name
[info] Failed: Total 1, Failed 0, Errors 1, Passed 0
[error] Error during tests:
[error] 	org.typelevel.scalacheck.xml.GeneratorsCheck
[error] (coreNative / Test / test) sbt.TestsFailedException: Tests unsuccessful

We targeted XML 1.0, Fourth Edition, which is what Xerces still uses. scala-xml has its own definitions. That leads to the following discrepancies:

scala> letter.filterNot(scala.xml.Utility.isNameStart)
val res6: Seq[Char] = List(ʻ, ʼ, ʽ, ʾ, ʿ, ˀ, ˁ, ՙ, ۥ, ۦ, ℮)

scala> (letter ++ digit ++ ".-_".toSeq ++ combiningChar ++ extender).filterNot(scala.xml.Utility.isNameChar)
val res15: Seq[Char] = List(℮, ۝, ۞, ·)

We could just use scala-xml's character sets, but I'm not sure it round trips.

@rossabaker
Copy link
Member Author

scala/scala-xml#607

@rossabaker
Copy link
Member Author

#5 fixes this for our purposes. Upstream discussion is linked above, which could let us simplify, but our work here is done for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant