tree-sitter / tree-sitter-scala

Scala grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parser gets stuck

Moddus opened this issue · comments

Commit of tree-sitter-scala you tested this on

70b4fe6

A code sample showing the error

Hi,

It looks like the the grammar on commit 70b4fe63c4 is causing an infinite loop e.g. running within tree-sitter-scala:

tree-sitter parse sample.scala --timeout 1000000

Please see attached the sample.scala:
sample.scala.txt

Could someone help explaining how this can be debugged?

Thanks for your time and suggestions

Show the error node

No error message as execution of tree-sitter is stuck.

What do you expect the tree to look like

No response

Where are you experiencing this error?

Running tree-sitter tool in CLI.

Maybe try binary search to minimize the example, and/or git bisect to find out when this has occurred.
If you go back to earlier tags in https://github.com/tree-sitter/tree-sitter-scala/releases does the problem still persist?

Good points! I can confirm v0.20.2 works where v0.20.3 and v0.21.0 don't.

Parsing with v0.20.2 reveals that there's a } missing at the end of the file.
Adding it allows it to be parsed with master (though there's another error).

Bisecting points to ef639d4 and consequently to 045ce59.

@ObserverOfTime Thanks!
So the relevant PR is #350 where _if_condition precedence became dynamic.