lezer-ludus/ludus.grammar
2023-11-26 13:32:25 -05:00

21 lines
407 B
Plaintext

@top Script { terminator* line+ }
@skip { space | comment }
line { expression terminator+ }
expression { Boolean | Nil | String | Number }
@tokens {
space { $[ \t\r]+ }
comment { "&" ![\n]* }
Boolean { "true" | "false" }
Nil { "nil" }
String { '"' (!["\\] | "\\" _)* '"' }
int { $[1-9]$[0-9]* }
float { ("0" | int ) $[0.9]+}
Number { int | float }
separator { $[,\n] }
terminator { $[;\n] }
}