Closed lehmacdj closed 1 year ago
sorry for the excessive force pushes, realized I forgot to handle trim
and non-trim heredocs separately, but should be good to go now
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:
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
@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.
Thank you. Looks good to me. Could you please resolve conflicts?
@mattn merged master rerunning make
to regenerate the js and py parsers to resolve the conflicts!
Thank you.
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 withvint
.Fixes #188.
let =<<
was already supported, but I thought it wasn't because the correct behavior fortrim
wasn't implemented.