Macro fungi_lang::fgi_decls
[−]
[src]
macro_rules! fgi_decls { { fromast $ast:expr } => { ... }; { # [ doc = $doc:tt ] $($d:tt)* } => { ... }; { use $path:ident :: * ; $($d:tt)* } => { ... }; { use ( $path:ident ) :: * ; $($d:tt)* } => { ... }; { idxtm $x:ident = ( $($i:tt)+ ) $($d:tt)* } => { ... }; { nmtm $x:ident = ( $($N:tt)+ ) $($d:tt)* } => { ... }; { type $t:ident = ( $($a:tt)+ ) $($d:tt)* } => { ... }; { val $x:ident : ( $($a:tt)+ ) = ( $($v:tt)+ ) $($d:tt)* } => { ... }; { val $x:ident = ( $($v:tt)+ ) $($d:tt)* } => { ... }; { fn $f:ident : ( $($a:tt)+ ) { $($e:tt)+ } $($d:tt)* } => { ... }; { fn $f:ident : ( $($a:tt)+ ) = { $($e:tt)+ } $($d:tt)* } => { ... }; { ; $($d:tt)* } => { ... }; { } => { ... }; { ^^ $e:expr } => { ... }; { { $($d:tt)+ } } => { ... }; { $($any:tt)* } => { ... }; }
Parser for declaration lists
d ::=
fromast ast (inject ast nodes)
use x :: * ; d (all decls in module x are made "local")
use ( path ) :: * ; d (all decls at module path p are made "local")
nmtm x = ( N ) d (define x as a name term N)
idxtm x = ( i ) d (define x as an index term i)
type t = ( A ) d (define a type alias `t` for value type `A`)
val x : ( A ) = ( v ) d (define a value v, of type A, bound to x)
val x = ( v ) d (define a value v, bound to x; synthesizes type from v)
fn f : ( A ) = { e } d (define a function f, of thunk type A, with recursive body e)
fn f : ( A ) { e } d (alternate syntax: optional equal sign)
; d (alternate syntax: optional semi colons, anywhere)
{ d } (alternate syntax: optional braces, anywhere)
(end) (no decls)