Macro fungi_lang::fgi_decls [] [src]

macro_rules! fgi_decls {
    { fromast $ast:expr } => { ... };
    { use $path:ident :: * ; $($d:tt)* } => { ... };
    { use ( $path:ident ) :: * ; $($d:tt)* } => { ... };
    { type $t:ident = ( $($a:tt)+ ) $($d:tt)* } => { ... };
    { val $x:ident : ( $($a:tt)+ ) = ( $($v:tt)+ ) $($d:tt)* } => { ... };
    { fn $f:ident : ( $($a:tt)+ )   { $($e:tt)+ } $($d:tt)* } => { ... };
    { fn $f:ident : ( $($a:tt)+ ) = { $($e:tt)+ } $($d:tt)* } => { ... };
    { ; $($d:tt)* } => { ... };
    { } => { ... };
    { $($any:tt)* } => { ... };
}

Parser for declaration lists

d ::=
    fromast ast                (inject ast nodes)
    use ( hostpath ) :: * ; d  (all module items from path are put into local scope)
    type t = ( A ) d           (in local scope, define a type alias `t` for value type `A`)
    val x : ( A ) = ( v ) d    (in local scope, define a value v, of type A, bound to x)
    fn f : ( A ) = { e } d     (in local scope, define a function f, of thunk type A, with recursive body e)
    fn f : ( A ) { e } d       (alternate syntax: equal sign is optional)
    ; d                        (alternate syntax: optional semi colons can go between decls)