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

fix: filter comment nodes when compile ForStmt #267

Merged
merged 1 commit into from
May 4, 2023

Conversation

lihebi
Copy link
Collaborator

@lihebi lihebi commented May 4, 2023

Tree-sitter normally parses a for-statement into [left,right,body], but if there're comments at the beginning of the body, it will be parsed into [left,right,comment,comment,...,body]. This causes our compiler to miss the real body. This PR fixes it.

Before, no unbound identifiers are marked:

Screenshot from 2023-05-04 08-28-15

After, unbound identifiers are marked correctly:

Screenshot from 2023-05-04 08-28-02

@lihebi lihebi merged commit 8764976 into codepod-io:main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant