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

support all valid unicode chars for varsym #95

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Conversation

tek
Copy link
Contributor

@tek tek commented Feb 8, 2023

Fixes #93.

Not sure what the best place to put this function is. I didn't want to include it in scanner.c in order to keep its size manageable. Also unsure whether that header needs to be specified explicitly when building.

@414owen @maxbrunsfeld please advise!

@414owen
Copy link
Contributor

414owen commented Feb 8, 2023

Good feature.

It's not very usual to put a function definition in a C header file (although quite normal to put functions inside templates inside c++ headers I think...). Would it be possible to make this a C file, mark the function as non-static, and add a predeclaration to the top of scanner.c?

@tek
Copy link
Contributor Author

tek commented Feb 8, 2023

yeah, that sounds sensible. No idea how to tell tree-sitter about this file though when running tree-sitter generate. It doesn't link it on its own at least.
Since we're only using the header in one C file, does it make much of a difference to use a header? I'd assume that an extra C file would have to be specified explicitly in downstream apps like nvim-treesitter.

@tek
Copy link
Contributor Author

tek commented Feb 8, 2023

tree-sitter/tree-sitter#1262

seems we're out of luck

@tek
Copy link
Contributor Author

tek commented Feb 8, 2023

At least the variant with the header appears to install fine in Neovim!

@414owen
Copy link
Contributor

414owen commented Feb 9, 2023

Okay, well the header sounds like an okay solution :)

Shame we can't have multiple source files though...

@tek
Copy link
Contributor Author

tek commented Feb 9, 2023

yeah well, if that issue I linked is going to be implemented we can just change it :) so I'll go ahead and merge.

@tek tek merged commit 3bdba07 into master Feb 9, 2023
@tek tek deleted the tek/unicode-symbols branch February 9, 2023 01:03
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 this pull request may close these issues.

UnicodeSyntax support
2 participants