|
|
|
@ -8,7 +8,7 @@ char = { !NEWLINE ~ ANY }
|
|
|
|
|
// http://pest.rs/book/grammars/syntax.html#atomic
|
|
|
|
|
inner = @{ char* }
|
|
|
|
|
|
|
|
|
|
token = { string | array | boolean | keyword }
|
|
|
|
|
token = { string | array | boolean | number | keyword }
|
|
|
|
|
|
|
|
|
|
// KEYWORDS
|
|
|
|
|
// has to be atomic for no implicit separate (spaces)
|
|
|
|
@ -37,6 +37,13 @@ array = {
|
|
|
|
|
// BOOLEAN
|
|
|
|
|
boolean = { "True" | "False" }
|
|
|
|
|
|
|
|
|
|
// NUMBER
|
|
|
|
|
number = @{
|
|
|
|
|
"-"?
|
|
|
|
|
~ ("0" | ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*)
|
|
|
|
|
~ ("." ~ ASCII_DIGIT*)?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// comments are a # followed by
|
|
|
|
|
// any number of non-newline characters
|
|
|
|
|
COMMENT = _{ "#" ~ char* }
|
|
|
|
|