lezer-ludus/ludus.grammar

21 lines
407 B
Plaintext
Raw Normal View History

2023-11-26 18:32:25 +00:00
@top Script { terminator* line+ }
2023-11-26 18:00:23 +00:00
2023-11-26 18:32:25 +00:00
@skip { space | comment }
line { expression terminator+ }
expression { Boolean | Nil | String | Number }
2023-11-26 18:00:23 +00:00
@tokens {
2023-11-26 18:32:25 +00:00
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] }
2023-11-26 18:00:23 +00:00
}