Escape sequences

It will, of course, be necessary to sometimes print reserved characters, or characters that cannot be typed on a standard keyboard. To this end, Rant offers escape sequences.

Character escape sequences

Any reserved (and most non-reserved) characters can be printed by prefixing each one with a backslash character:

\{This text will print with braces around it\}

Special escape sequences

Certain characters are not interpreted verbatim when escaped, and instead have special meaning. Here's a list of them:

Escape sequenceOutput character
\rCarriage return (U+000D)
\nLine feed (U+000A)
\sSpace (U+0020)
\tTab (U+0009)
\0Null character (U+0000)
\xXXUTF-8 character code [See below]

Unicode escape sequences

Escape sequences can also be used to print characters by their Unicode code point in hexadecimal format:

\xE4    # 'รค'