pub enum Statement<'a> {
Expression(Expression<'a>),
DefineVariable(DefineVariable<'a>),
DefineFunction {
function_name: &'a str,
decorators: Vec<Decorator<'a>>,
type_parameters: Vec<(&'a str, Option<TypeParameterBound>)>,
parameters: Vec<(Span, &'a str, Option<TypeAnnotation>, Markup)>,
body: Option<Expression<'a>>,
local_variables: Vec<DefineVariable<'a>>,
fn_type: TypeScheme,
return_type_annotation: Option<TypeAnnotation>,
readable_return_type: Markup,
},
DefineDimension(&'a str, Vec<TypeExpression>),
DefineBaseUnit {
name: &'a str,
identifier_span: Span,
decorators: Vec<Decorator<'a>>,
type_annotation: Option<TypeAnnotation>,
type_scheme: TypeScheme,
},
DefineDerivedUnit {
name: &'a str,
identifier_span: Span,
expr: Expression<'a>,
decorators: Vec<Decorator<'a>>,
type_annotation: Option<TypeAnnotation>,
type_scheme: TypeScheme,
readable_type: Markup,
},
ProcedureCall {
kind: ProcedureKind,
span: Span,
args: Vec<Expression<'a>>,
},
DefineStruct(StructInfo),
}Variants§
Expression(Expression<'a>)
DefineVariable(DefineVariable<'a>)
DefineFunction
Fields
§
fn_type: TypeSchemeDefineDimension(&'a str, Vec<TypeExpression>)
DefineBaseUnit
DefineDerivedUnit
ProcedureCall
DefineStruct(StructInfo)
Implementations§
Trait Implementations§
Source§impl PrettyPrint for Statement<'_>
impl PrettyPrint for Statement<'_>
Source§fn pretty_print(&self) -> Markup
fn pretty_print(&self) -> Markup
Pretty prints with default options.
impl<'a> StructuralPartialEq for Statement<'a>
Auto Trait Implementations§
impl<'a> Freeze for Statement<'a>
impl<'a> RefUnwindSafe for Statement<'a>
impl<'a> Send for Statement<'a>
impl<'a> Sync for Statement<'a>
impl<'a> Unpin for Statement<'a>
impl<'a> UnwindSafe for Statement<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more