Subject: | extract_codeblock can't distinguish '<<' the operator from '<<' the here-doc starter |
These work:
extract_codeblock("{1<<2}");
extract_codeblock("{1<<2}\n");
This does not:
extract_codeblock("{1<<2}\n\n");
The problem string diverges from the others on a call to
_match_quotelike at position 2 (the '<<'). _match_quotelike begins to
interpret this as a heredoc with the implicit label "", when
extract_quoteblock probably should have known to expect an expression
operator like left shift, rather than a here-doc/string.
Unfortunately, it doesn't look like _match_codeblock really knows if
it's in an expression or not, and adding that sort of state is probably
fraught with peril. At the very least, this should be noted in the BUGS
section of the documentation.
Jeremy