tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: parser stuck in infinite loop with multiple open clauses

WesleyYue opened this issue · comments

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues of tree-sitter-typescript

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Parsing the following code hangs forever on v0.20.5

try {
  console.log("foo");
} catch (err) {
  if (true) {
    console.log("bar");
  } else {
    throw new MyError(a, b

Steps To Reproduce/Bad Parse Tree

No parse tree. Hangs forever.

Expected Behavior/Parse Tree

Expect to not hang :)

Repro

try {
  console.log("foo");
} catch (err) {
  if (true) {
    console.log("bar");
  } else {
    throw new MyError(a, b