ngalaiko / tree-sitter-go-template

Golang template grammar for tree-sitter
MIT License
74 stars 27 forks source link

Fix else bug #8

Closed qvalentin closed 9 months ago

qvalentin commented 9 months ago

@baptman21 can you review the changes?

Bug description: Before these changes having a template inside a else block would cause a parsing error. The grammar for if-actions with else blocks in not solveable with LR(1) because the beginning of a template can not be differentiated from the beginning of the else or end tag.

baptman21 commented 9 months ago

Looks OK, I cannot check myself before tomorrow but the bug was a parsing error before ? Could you update the description to explain in one or two sentences the bug please ?

qvalentin commented 9 months ago

Looks OK, I cannot check myself before tomorrow but the bug was a parsing error before ? Could you update the description to explain in one or two sentences the bug please ?

Thanks, don't feel hurried with checking it out. I updated the description. To see the bug in action, just run the tests with the old grammar.js.