Skip to content

allow leading spaces for heredoc end marker #190

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

Merged
merged 5 commits into from
Jun 22, 2023
Merged

Conversation

lehmacdj
Copy link
Contributor

@lehmacdj lehmacdj commented Jul 10, 2022

The extra test cases that I include in test_heredoc.vim are accepted by vim (you can check by doing :source test/test_heredoc.vim but aren't accepted by this library and result in a parse error.

This was annoying me by making it impossible to lint a file in my vim config that extensively uses the let =<< heredocs with vint.

Fixes #188. let =<< was already supported, but I thought it wasn't because the correct behavior for trim wasn't implemented.

@lehmacdj
Copy link
Contributor Author

sorry for the excessive force pushes, realized I forgot to handle trim and non-trim heredocs separately, but should be good to go now

@lehmacdj
Copy link
Contributor Author

Is this ready to be merged or do I need to add more coverage? The codecov result is misleading because it's counting the python parser as a newly added file for some reason:

Screen Shot 2022-07-12 at 7 55 35 PM

@lehmacdj
Copy link
Contributor Author

lehmacdj commented Aug 7, 2022

I added some more test coverage that should bring the patch coverage to 100% and prevent decreasing the overall test coverage percentage.

I also had added some negative test cases, unfortunately the line numbers returned in the errors are off by one between the javascript and the python/vim (which are consistent with each other). For example, I got the following result for one of my tests:

--- test/test_heredoc_fail_on_too_little_indent.out	2022-08-06 22:38:48.000000000 -0700
+++ test/test_heredoc_fail_on_too_little_indent.ok	2022-08-06 22:34:27.000000000 -0700
@@ -1 +1 @@
-vimlparser: E990: Missing end marker 'EOS': line 6 col 0
+vimlparser: E990: Missing end marker 'EOS': line 5 col 0

@lehmacdj
Copy link
Contributor Author

@mattn is there anything that is blocking this change (other than merge conflicts)? Would be happy to make a revision if you would accept this patch with some revisions.

@mattn
Copy link
Member

mattn commented Jun 22, 2023

Thank you. Looks good to me. Could you please resolve conflicts?

@lehmacdj
Copy link
Contributor Author

@mattn merged master rerunning make to regenerate the js and py parsers to resolve the conflicts!

@mattn mattn merged commit 9766ea9 into vim-jp:master Jun 22, 2023
@mattn
Copy link
Member

mattn commented Jun 22, 2023

Thank you.

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.

Support :let=<< with leading spaces before EOF
2 participants