~tim/scheme-vm

4270ce41566c62f11898d379a357a4738925d26e — Tim Morgan 2 years ago 3c0fc6f
Oops. Don't need that any more.
1 files changed, 0 insertions(+), 37 deletions(-)

D src/lisp.pest
D src/lisp.pest => src/lisp.pest +0 -37
@@ 1,37 0,0 @@
whitespace = _{ "\t" | "\n" | " " }

escape = _{ "\\" ~ any }

string = ${ "\"" ~ ((!("\"" | "\\") ~ any) | escape)* ~ "\"" }

delimited_identifier_inner = ${ (!"|" ~ any)+ }

delimited_identifier = _{ "|" ~ delimited_identifier_inner ~ "|" }

simple_atom = ${ (!("(" | ")" | " " | "\t" | "\n" | "[" | "]" | "{" | "}" | "|") ~ any)+ }

quoted_atom = ${ quote ~ simple_atom }

atom = _{ quoted_atom | delimited_identifier | simple_atom }

sexp = _{ quoted_sexp | simple_sexp }

comment = { block_comment | line_comment | datum_comment }

expression = _{ string | comment | sexp | atom }

quote = !{ "'" | ",@" | "," | "`" }

quoted_sexp = ${ quote ~ simple_sexp }

simple_sexp = ${ "(" ~ whitespace* ~ expressions* ~ whitespace* ~ ")" }

block_comment = @{ "#|" ~ (!"|#" ~ any)* ~ "|#" }

line_comment = @{ ";" ~ (!"\n" ~ any)* }

datum_comment = @{ "#;" ~ " "? ~ (sexp | atom) }

expressions = _{ expression ~ (whitespace* ~ expression)* }

program = { soi ~ whitespace* ~ expressions ~ whitespace* ~ eoi }