Skip to content

Instantly share code, notes, and snippets.

@RayMPerry
Created September 10, 2019 01:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save RayMPerry/f8e1f8042bf1ccb81d491f5a3836fb20 to your computer and use it in GitHub Desktop.
Lisp Grammar WIP
use v6;
grammar RakuLisp {
token TOP { ^^ <statement> $$ }
token statement { [ <sexp> | <atom> ] }
rule sexp { '(' <statement> ')' }
proto token atom { * }
token atom:sym<int> { \d+ }
}
sub MAIN() {
say RakuLisp.parse('(1213 (12323 12323 (123123 12323)))');
}
# Local Variables:
# compile-command: "perl6 raku-lisp.p6"
# End:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment