Macro fungi_lang::fgi_vtype
source · macro_rules! fgi_vtype {
{ fromast $ast:expr } => { ... };
{ ($($type:tt)+) } => { ... };
{ user($s:ident) } => { ... };
{ Unit } => { ... };
{ + $($sum:tt)+ } => { ... };
{ x $($prod:tt)+ } => { ... };
{ Ref[$($i:tt)+] $($t:tt)+ } => { ... };
{ Thk[$($i:tt)+] $($e:tt)+ } => { ... };
{ Nm[$($i:tt)+] } => { ... };
{ $a:tt [$($i:tt)+] } => { ... };
{ $a:tt [$($i:tt)+] $($more:tt)+ } => { ... };
{ (Nm->Nm)[$($m:tt)+] } => { ... };
{ forallt $x:ident : $k:tt. $($a:tt)+ } => { ... };
{ forallt ($x:ident) : $k:tt. $($a:tt)+ } => { ... };
{ forallt ($x:ident,$($xs:ident),+):$k:tt.$($a:tt)+ } => { ... };
{ foralli $x:ident : $g:tt. $($a:tt)+ } => { ... };
{ foralli ($x:ident) : $g:tt. $($a:tt)+ } => { ... };
{ foralli ($x:ident,$($xs:ident),+):$g:tt.$($a:tt)+ } => { ... };
{ rec $a:ident.$($body:tt)+ } => { ... };
{ exists $var:ident : $a:tt . $($b:tt)+ } => { ... };
{ exists ($var:ident) : $a:tt . $($b:tt)+ } => { ... };
{ exists $var:ident : $a:tt | $p:tt . $($b:tt)+ } => { ... };
{ exists ($var:ident) : $a:tt | $p:tt . $($b:tt)+ } => { ... };
{ exists ($($vars:ident),+) : $a:tt . $($b:tt)+ } => { ... };
{ exists ($var:ident,$($vars:ident),+) : $a:tt | $p:tt . $($b:tt)+ } => { ... };
{ $a:tt $b:tt } => { ... };
{ $a:tt $b:tt $($more:tt)+ } => { ... };
{ $a:ident } => { ... };
{ $($any:tt)* } => { ... };
}
Expand description
Parser for value types
A,B ::=
fromast ast (inject ast nodes)
(A) (parens)
D,Bool,Seq,... (type constructors)
user(type) (user-defined)
Unit (unit)
+ A + B ... (extended sums)
x A x B ... (extended product)
Ref[i] A (named ref cell)
Thk[i] E (named thunk with effects)
Nm[i] (name type)
A[i]... (extended application of type to index)
(Nm->Nm)[M] (name function type)
forallt (a,b,...):K.A (type parameter)
foralli (a,b,...):g.A (index parameter)
rec a.A (recursive type)
exists (X,Y,...):g | P . A
(existential index variables, with common sort g)
A B ... (extended application of type constructor to type)
a (type var (lowercase), or type ident (uppercase))