From b338d7e2ae3d9e921d513943bd8fcd1043d60dd1 Mon Sep 17 00:00:00 2001 From: syn Date: Mon, 25 May 2020 20:17:39 +0300 Subject: Finish typing Every single piece of fucking shit is typed now --- types/tl.pest | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 types/tl.pest (limited to 'types/tl.pest') 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 } -- cgit v1.2.1-18-gbd029