You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
853 B
28 lines
853 B
whitespace = _{ " " | "\t" | "\r" | "\n" } |
|
multi_comment = { "/*" ~ (!"*/" ~ ANY)* ~ "*/" } |
|
single_comment = { "//" ~ (!NEWLINE ~ ANY)* } |
|
identifier = { ASCII_ALPHA+ ~ (ASCII_ALPHA | ASCII_DIGIT | "_")* } |
|
rvalue = { ('a'..'z' | 'A'..'Z' | '0'..'9' | "_" | ".")+ } |
|
middle = { (whitespace | multi_comment)+ } |
|
|
|
include = { "#" ~ identifier ~ middle ~ "\"" ~ identifier ~ "\"" } |
|
attribution = { identifier ~ middle ~ rvalue ~ ";" } |
|
dictionary = { identifier ~ middle ~ "{" ~ ( |
|
dictionary |
|
| attribution |
|
| whitespace |
|
| multi_comment |
|
| single_comment |
|
| include |
|
)+ ~ "}" } |
|
list_size = _{ ASCII_DIGIT+ ~ whitespace+ } |
|
list = { identifier ~ middle ~ list_size? ~ "(" ~ (rvalue | whitespace | multi_comment | single_comment)+ ~ ");" } |
|
|
|
file = { SOI ~ ( |
|
whitespace |
|
| multi_comment |
|
| single_comment |
|
| dictionary |
|
| list |
|
| attribution)* |
|
~ EOI }
|
|
|