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

Missing ranges in NameStartChar #407

Open
kddnewton opened this issue Oct 11, 2022 · 3 comments
Open

Missing ranges in NameStartChar #407

kddnewton opened this issue Oct 11, 2022 · 3 comments

Comments

@kddnewton
Copy link
Contributor

Looks like in the lexer is missing a couple of entries in its regex for NameStartChar.

I'm seeing

"(:|[a-zA-Z]|_|\\u2070-\\u218F|\\u2C00-\\u2FEF|\\u3001-\\uD7FF|\\uF900-\\uFDCF|\\uFDF0-\\uFFFD)"
, which includes:

":" | [A-Z] | "_" | [a-z] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD]

But the spec has:

":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

So it's missing some entries in the 1-byte form and then anything #x10000 and above.

@kddnewton
Copy link
Contributor Author

cc @bd82 this came from an issue on prettier here: prettier/plugin-xml#607.

@bd82
Copy link
Member

bd82 commented Nov 16, 2022

Hello @kddnewton

This could be a bit tricky, specifically: [#x10000-#xEFFFF] range will need to be converted to the matching surrogate pair range in JavaScript
-https://mathiasbynens.be/notes/javascript-unicode

@kddnewton
Copy link
Contributor Author

@bd82 yeah totally get it. I think that's fine to skip those for now, the issue I'm facing is within

[#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D]

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

2 participants