tree-sitter / tree-sitter-css

CSS grammar for Tree-sitter
MIT License
85 stars 34 forks source link

bug: Identifier considers non-ASCII an error #50

Closed anarchodin closed 1 week ago

anarchodin commented 2 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

In an editor, I noticed that a class selector gets marked as an error if I use non-ASCII letters. Looking at the source code here, it seems that identifiers are constrained to ASCII. This is not correct; CSS allows basically any non-ASCII character in identifiers.

Steps To Reproduce/Bad Parse Tree

Use a non-ASCII character in an identifier. One example is the letter á.

Expected Behavior/Parse Tree

Non-ASCII letters should not appear as errors.

Repro

/* Example code that fails to parse */
.skráning {
  background-color: white;
}
amaanq commented 1 week ago

thanks for the bug report, this is now fixed