Enum rustre_parser::parser::Decl
source[−]pub enum Decl<'a, 'f> {
Const {
name: Ident<'a, 'f>,
value: Option<Spanned<'f, Expr<'a, 'f>>>,
ty: Option<TyExpr<'a, 'f>>,
},
Ty {
name: Spanned<'f, Ident<'a, 'f>>,
value: Spanned<'f, TyDecl<'a, 'f>>,
},
ExternalNode {
is_unsafe: bool,
is_function: bool,
name: Spanned<'f, Ident<'a, 'f>>,
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
},
Node {
is_unsafe: bool,
is_function: bool,
name: Spanned<'f, Ident<'a, 'f>>,
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
vars: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
consts: Vec<Spanned<'f, Decl<'a, 'f>>>,
body: Vec<Spanned<'f, BodyItem<'a, 'f>>>,
},
AliasNode {
is_unsafe: bool,
is_function: bool,
name: Spanned<'f, Ident<'a, 'f>>,
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
effective_node: Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>,
},
Model {
name: Spanned<'f, Ident<'a, 'f>>,
uses: Vec<Spanned<'f, Ident<'a, 'f>>>,
needs: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>,
body: Vec<Spanned<'f, Decl<'a, 'f>>>,
},
PackageAlias {
name: Spanned<'f, Ident<'a, 'f>>,
model: Spanned<'f, Ident<'a, 'f>>,
static_params: Vec<(Spanned<'f, Ident<'a, 'f>>, StaticArg<'a, 'f>)>,
},
Package {
name: Spanned<'f, Ident<'a, 'f>>,
uses: Vec<Spanned<'f, Ident<'a, 'f>>>,
provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>,
body: Vec<Spanned<'f, Decl<'a, 'f>>>,
},
}
Expand description
A single declaration
Variants
Const
Fields
name: Ident<'a, 'f>
Name of the constant
Constant declaration
Ty
Fields
Type declaration
ExternalNode
Fields
is_unsafe: bool
Is it unsafe
is_function: bool
Is it a functional node
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>
The static parameters it takes
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
The dynamic parameters it takes
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
Its outputs
An external node.
Node
Fields
is_unsafe: bool
Is it unsafe
is_function: bool
Is it a functional node
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>
The static parameters it takes
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
The dynamic parameters it takes
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
Its outputs
vars: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
The local variables of this node
A local node
AliasNode
Fields
is_unsafe: bool
Is it unsafe
is_function: bool
Is it a functional node
static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>
The static parameters it takes
params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
The dynamic parameters it takes
outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>
Its outputs
An alias node
Model
Fields
needs: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>
What functions/nodes/types/constants this model needs
provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>
What functions/nodes/types/constants this model should provides
A package model
PackageAlias
Fields
A package alias
Package
Fields
provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>
What definitions it provides
A package definition