Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Infinite loop in tsx parser #323

Open
2 tasks done
macuyler opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

bug: Infinite loop in tsx parser #323

macuyler opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@macuyler
Copy link

macuyler commented Jan 8, 2025

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)

tree-sitter 0.24.6

Describe the bug

When running the tsx parser on input such as the following:

<div style={{ textAlign:>Note: This is important. (And this)</div>

The parser never completes or fails, it seemingly loops forever.

I have successfully reproduced the issue on 8e13e1d.

Steps To Reproduce/Bad Parse Tree

The most basic reproduce case that I could find is:

<a {{b:>c:d(e f)

If you attempt to parse this code with the tsx parser, it will loop forever.

git clone https://github.com/tree-sitter/tree-sitter-typescript
cd tree-sitter-typescript/tsx
echo "<a {{b:>c:d(e f)" > poc.tsx
tree-sitter parse -d poc.tsx

Expected Behavior/Parse Tree

The expected behavior should be a proper parsing failure response.

Repro

<a {{b:>c:d(e f)
@macuyler macuyler added the bug label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant