Skip to content

Instantly share code, notes, and snippets.

@jeremiahbiard
Created December 12, 2015 02:32
Show Gist options
  • Save jeremiahbiard/e9c1aed9efc8a5c1edb1 to your computer and use it in GitHub Desktop.
Save jeremiahbiard/e9c1aed9efc8a5c1edb1 to your computer and use it in GitHub Desktop.
start =
expression
validchar
= [0-9a-zA-Z_?!+\-=@#$%^&*/.]
_ =
" "*
list
= "(" _ expr: expression* _ ")" { return expr; }
// Expression is either an atom or a list of expressions surrounded by parens
expression
= _ e:(atom / list) _ { return e; }
atom =
chars:validchar+
{ return chars.join(""); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment