Teach AUTOs to process escaped backslashes at the end of quoted strings (#1831)#1840
Teach AUTOs to process escaped backslashes at the end of quoted strings (#1831)#1840acr4 wants to merge 1 commit intoveripool:masterfrom
Conversation
…gs (veripool#1831) "...\\..." is a string containing a backslash: \ "...\"..." is a string containing a double-quote: " When parsing double-quoted strings, we must detect embedded escaped backslashes and double-quotes. Detecting when a string terminates with one or more of these characters is tricky. Strings terminating in "...\"" are not uncommon, and have reasonably robust support, but strings terminating in "...\\" are quite rare, and were quite broken. This patch aims to improve the detection of "...\\" (or "...\\\\", or any even number of backslashes in a row immediately preceding a double-quote string terminator.
|
@wsnyder this isn't ready yet... It works on some test-cases, but this trivial one fails: |
|
I'm sure this could be done more cleverly with some But now I'm starting to peel the onion a little more and I see that both I suspect we may need to add a new function that abstracts complex string traversal and returns the end-point for a given double-quotes start-point, then call that wherever string boundaries need to be detected. |
"...\..." is a string containing a backslash:
"..."..." is a string containing a double-quote: "
When parsing double-quoted strings, we must detect embedded escaped backslashes and double-quotes. Detecting when a string terminates with one or more of these characters is tricky. Strings terminating in "..."" are not uncommon, and have reasonably robust support, but strings terminating in "...\" are quite rare, and were quite broken.
This patch aims to improve the detection of "...\" (or "...\\", or any even number of backslashes in a row immediately preceding a double-quote string terminator.