Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BBCode grammar
grammar BBCode {
regex TOP { (<para> | <code>)* }
regex para { [\N+ [\n|$]]+ [\n|$] }
regex code { '[code]' .* '[/code]' <.ws> }
}
BBCode.parse: Q:to[END];
[code]
a := f()
[/code]
just a line
another line
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment