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:
[x] All tests pass in CI.
[x] There are sufficient tests for the new fix/feature.
[x] Grammar rules have not been renamed unless absolutely necessary.
[x] The conflicts section hasn't grown too much.
[x] The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).
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 callingmark_end
,advancing
a bit, and subsequently trying to scan a next token which makes no sense.@hendrikvanantwerpen
Checklist: