2 ms·
I have used tree-sitter, but only for a very simple use case. The main shortcoming I am aware of are error messages, see here: https://github.com/tree-sitter/t
by patrec 6y ago
I have used tree-sitter, but only for a very simple use case. The main shortcoming I am aware of are error messages, see here:
https://github.com/tree-sitter/tree-sitter/issues/255 https://github.com/tree-sitter/tree-sitter/issues/255
Tree sitter will basically always generate a parse tree, even for malformed input, in which case it will add ERROR nodes for the bits it doesn't like (it will also inform you that there were problems with the parse by setting a boolean attribute). So you have some information you can use to construct a useful error message yourself, but some parser generators will handle this better (although it has to be said that the difficulty of obtaining good error messages from a parser generator are still one of the main the reasons production parsers are mostly written by hand).
- guerrilla 6y agoAh I see, so the reparation isn't avoidable for now? That doesn't seem very appropraite for compilers then.
- patrec 6y agoWhy would it not be appropriate? The only annoyance I see is that currently you will have to generate a good error message from it yourself, but a first pass at the problem shouldn't be too onerous.
- guerrilla 6y agoOk, I misunderstood. I thought it repaired without error sometimes but I see that you were clear that that isn't the case.