diff options
Diffstat (limited to 'types/tl.pest')
-rw-r--r-- | types/tl.pest | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/types/tl.pest b/types/tl.pest new file mode 100644 index 0000000..f864772 --- /dev/null +++ b/types/tl.pest @@ -0,0 +1,27 @@ +WHITESPACE = _{ " " | "\n" } + +ident = @{ ASCII_ALPHA ~ (ASCII_ALPHANUMERIC | "_")* } + +vector = { "vector<" ~ typeid ~ ">" } + +typeid = { vector | ident } + +param = { ident ~ ":" ~ typeid } + +param_list = { param* } + +typedef = { ident ~ param_list ~ "=" ~ ident ~ ";" } + +docdescr = ${ ("\n//-"? ~ !"\n" ~ !"@" ~ ANY)* } + +docparam = ${ "@" ~ ident ~ " " ~ docdescr } + +docstring = ${ ("//" ~ docparam+ ~ ("\n")+)+ } + +section = { "---" ~ ident ~ "---"} + +definition = { docstring ~ typedef } + +item = _{ definition | section } + +tl = _{ SOI ~ (item)* ~ EOI } |