Raw text mode

This mode of the parser simply accumulates text until some special character is encountered. The following special characters can influence parsing raw text:

Entering Lisp mode

The character following the opening bracket might have some special implications too:

Directives

Only one parser directive is supported for now:

.SYNTAX — allows you to modify the start/end special characters (which are initially the brackets). For example:

{(+ 1 2)}
{.SYNTAX "[" "]"}
{(+ 1 2)}
[(+ 1 2)]

Will output:

3
{(+ 1 2)}
3

I'm using this trick in these pages in order to make it easier to type examples in the standard syntax. Note that you can use pretty much any character, they don't have to be brackets or pairs—just make sure to not use one of the characters that are special in raw mode, as well as some characters that you really need in Lisp mode, such as round brackets or the quote/backquotes. Example:

{.SYNTAX "@" "@"}
@(list 'foo 'bar)@
@(strcat 'foo 'bar 'baz)@
{(list 'foo 'bar)}             <!-- literal -->
{(strcat 'foo 'bar 'baz)}

; to change it back we have to use the new sign now:
@.SYNTAX "{" "}"@
{(strcat 'foo 'bar 'baz)}

Note that even though .SYNTAX takes string arguments, the special tokens are characters (so don't try to use a longer string as it won't work, at least for now).

Fork me on Github