Closed 314eter closed 4 years ago
@314eter This is great! I think that the problem with supertypes can be fixed on the Haskell end; we can introspect whether a given rule has a _
prefix and prepend its identifier with Internal
or Private
or whatever. Would you mind filing a bug about this issue?
Good to go once @aymannadeem gives the final OK.
We can introspect whether a given rule has a
_
prefix and prepend its identifier withInternal
orPrivate
or whatever.
That was my idea, but that would change some identifiers that are already in use. I forgot that the haskell typechecker solves that problem.
I added some reserved names that should be avoided as haskell identifier. I took the list from https://wiki.haskell.org/Keywords. The space character was missing from the list of special characters.
The field names
class
anddefault
, and the anonymous node" "
currently occur in tree-sitter-ocaml.Another problem that I encountered is that some supertypes (e.g.
_sequence_expression
) are too similar to other nodes (sequence_expression
) and result in the same identifier. I don't think this can be solved by haskell-tree-sitter in a backwards compatible way, so this should probably be forbidden by tree-sitter (and documented).