tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
176 stars 58 forks source link

Fix non-termination in parser #239

Closed aibaars closed 1 year ago

aibaars commented 1 year ago

My earlier changes https://github.com/tree-sitter/tree-sitter-ruby/pull/238 somehow caused the parser to hang on some inputs. I'm not sure how it ended up in an infinite loop, but the changes I made to the scanner were not entirely right. I changed the scanner to return false if it sees a newline before a . character that has no following . character otherwise we'd end up calling mark_end, advancing a bit, and subsequently trying to scan a next token which makes no sense.

@hendrikvanantwerpen

Checklist: