tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
151 stars 36 forks source link

support all valid unicode chars for varsym #95

Closed tek closed 1 year ago

tek commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

https://github.com/tree-sitter/tree-sitter/issues/1262

seems we're out of luck

tek commented 1 year ago

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

414owen commented 1 year ago

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

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

tek commented 1 year ago

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