You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tree-sitter: ambiguous grammar, Makefile, unicode, and comments #556
Currently bnfc --tree-sitter will finish normally, but tree-sitter generate will fail:
Unresolved conflict for symbol sequence:
Exp '+' Exp • '+' …
Possible interpretations:
1: (Exp Exp '+' Exp) • '+' …
2: Exp '+' (Exp Exp • '+' Exp)
Possible resolutions:
1: Specify a left or right associativity in `Exp`
2: Add a conflict for these rules: `Exp`
Many other tools like happy and bison will choose one of them (maybe with a warning), but I am not sure what the best practice should be for tree-sitter.
Currently the generated Makefile is placed under tree-sitter-xxx/, while for most of other backends (including --latex) it is directly placed at current directory. Should we align it with other backends, or is this a special design?
Unicode: test testing/regression-tests/249_unicode failed.
Comments: test testing/regression-tests/202_comments failed.
@katrinafyi For the first one, maybe it is fine to keep it unchanged (with some extra info in docs?)? It could be quite complicated to add such checks (also, making decisions implicitly can be confusing sometimes?). But it is up to you to choose the best behavior :)
Yeah, I'm just not sure what the best way would be. In my own use of the tree-sitter backend, I've just resolved the ambiguities in the source .cf file and I think this is good because it ensures consistent behaviour across backends, rather than trying to match the implicit behaviour of other backends. So, I'm leaning towards leaving it as-is but, yes, some info in docs would be good. I'll write that eventually.. :)
Activity
Commelina commentedon Mar 26, 2026
@katrinafyi For the first one, maybe it is fine to keep it unchanged (with some extra info in docs?)? It could be quite complicated to add such checks (also, making decisions implicitly can be confusing sometimes?). But it is up to you to choose the best behavior :)
katrinafyi commentedon Mar 27, 2026
Yeah, I'm just not sure what the best way would be. In my own use of the tree-sitter backend, I've just resolved the ambiguities in the source .cf file and I think this is good because it ensures consistent behaviour across backends, rather than trying to match the implicit behaviour of other backends. So, I'm leaning towards leaving it as-is but, yes, some info in docs would be good. I'll write that eventually.. :)