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

variable name in chinese recognized as error #171

Closed
vpxyz opened this issue Apr 12, 2023 · 1 comment · Fixed by #216
Closed

variable name in chinese recognized as error #171

vpxyz opened this issue Apr 12, 2023 · 1 comment · Fixed by #216

Comments

@vpxyz
Copy link

vpxyz commented Apr 12, 2023

Hi,
tree-sitter-php seems to be unable to recognize valid variable names with Chinese characters:

<?php
$漢字;

produces this syntax tree:

(program (php_tag)
 (ERROR $ (ERROR))
 (empty_statement ;))

Tested with tree-sitter 0.20.7 and the latest tree-sitter-php source tree.
Thank you

@reverland
Copy link

As #142 stated, it is now not conform to php implementation.

Even worse, php also allow non-utf8/16 encoding label/var name, tree-sitter won't allow it.

But for just Chinese characters, if encoded in utf8/16, it is possible to just change the rule to just support it may be just sufficient.

If other encoding is considred, you need to extend tree-sitter to support other encoding.

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

Successfully merging a pull request may close this issue.

2 participants