Another thought: instead of newline() why not have character('name') where 'name' is the letter used in the escape? That lets us add more characters without risk of breaking things or needing to introduce more functions.
We could adapt names from the python standard escape sequence table.
Code:
\\ - backslash
\' - quote (')
\" - double_quote (")
\b - backspace
\n - newline (LF)
\r - return (CR)
\t - tab (TAB)
Examples:
Code:
character('newline') returns '\n'
character('return') returns '\r'
character('tab') returns '\t'
character('backspace') returns '\b'
character('backslash') returns '\\'