fix #99: implement commented string_quote_removal
Thanks, can you make this work in 3.7 as well?
I worried the walrus operator was suspicious, albeit more concise. hopefully removing it does the trick for py3.7
There seems to be more to this function than just single quotes: https://github.com/bminor/bash/blob/master/subst.c#L11892
Like double quotes, escape characters. Can you maybe leave a todo if you're not going to add that part?
sorry for the long delay! The initial start/end strip now handles double quotes. And within token quotes and escaped-quotes are managed.
I'm not sure I've gotten the edge cases correct. And I'm assuming unbalanced non-escaped quotes would have had a parsing error before getting here. currently string_quote_removal removes all non-escaped quotes without checking if they're paired.
Surprisingly (to me) these are all valid bash HEREDOCs
cat << "HERE\"DOC"
example: quote in quote
HERE"DOC
cat << HERE\"DOC
example: one double quote
HERE"DOC
cat << HERE"x"DOC
example: string
HERExDOC