Skip to content

Fix scanning of heredoc_body to allow empty bodies - #137

Merged
verhovsky merged 2 commits into
tree-sitter:masterfrom
jaopaulolc:master
Nov 28, 2022
Merged

verhovsky merged 2 commits into
tree-sitter:masterfrom
jaopaulolc:master

Conversation

@jaopaulolc

Copy link
Copy Markdown
Contributor

Empty heredoc_body such as the example bellow was being miss parsed:

echo <<EOF
EOF
echo "Hello"

In the example above EOF\necho "Hello" was captured as heredoc_body.

This PR fixes the scanning of heredoc_body to allow for heredocs with empty bodies to be correctly parsed.

@verhovsky

Copy link
Copy Markdown
Collaborator

Could you add a test please?

@jaopaulolc

Copy link
Copy Markdown
Contributor Author

Could you add a test please?

Added a test, @verhovsky. The test basically has 4 variants of heredocs with empty bodies. Let me know if the test/parsed tree are to large/verbose.

@jaopaulolc

jaopaulolc commented Nov 27, 2022 •

Copy link
Copy Markdown
Contributor Author

@verhovsky Just checking in to see I should improve/change so this change can be merged in.

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.

2 participants