Brachylog
Brachylog copied to clipboard
Backslash escapes quotation mark even when escaped.
"\" gets treated as quotation, but even "\\" gets treated as quotation.
@kckennylau Both "\" and "\\" are incorrect syntax, even though TIO doesn't print an error for it (which it should). So I don't see how you saw it get treated as quotation.
Though I now realize that the string "" isn't typable (because \ only escapes "). I might change it so that " escapes ".
http://brachylog.tryitonline.net/#code=OmVmLg&input=IlxcIg&args=Wg
@kckennylau This is extremely annoying to fix because TIO reads the input from a file, and in the offline intrepreter you can input a string in an atom (single quotes) or directly as a term too. Those three scenarios all have different escaping rules: in the file, no escaping is performed before I get to parse it, in an atom \" is escaped as " like a normal ", and in a string term it escapes as expected with backslashes.