Finally got the an IMAP response with string literals containing CRLF sequences to scan into a single line to pass to the parser. Created inline references to the literals using a modified literal syntax. Utter madness.