Enum valkyrie_ast::StatementKind
source · pub enum StatementKind {
Show 17 variants
Nothing,
Document(Box<DocumentationList>),
Annotation(Box<AttributeList>),
Namespace(Box<NamespaceDeclaration>),
Import(Box<ImportStatement>),
Class(Box<ClassDeclaration>),
Union(Box<UnionDeclaration>),
Enumerate(Box<FlagDeclaration>),
Trait(Box<TraitDeclaration>),
Extends(Box<ExtendsStatement>),
Function(Box<FunctionDeclaration>),
Variable(Box<LetBindNode>),
Guard(Box<GuardStatement>),
While(Box<WhileLoop>),
For(Box<ForLoop>),
Control(Box<ControlNode>),
Expression(Box<ExpressionNode>),
}Expand description
The top level elements in script mode.
Variants§
Nothing
Placeholder for when the parser fails to parse a statement.
Document(Box<DocumentationList>)
The documentation node, must have acceptor underneath.
Annotation(Box<AttributeList>)
The annotation list node.
Namespace(Box<NamespaceDeclaration>)
The namespace declaration node.
Import(Box<ImportStatement>)
The import statement node.
Class(Box<ClassDeclaration>)
The class declaration node.
Union(Box<UnionDeclaration>)
The union declaration node.
Enumerate(Box<FlagDeclaration>)
The enumerate declaration node.
Trait(Box<TraitDeclaration>)
The trait declaration node
Extends(Box<ExtendsStatement>)
The type extension node
Function(Box<FunctionDeclaration>)
The function declaration node.
Variable(Box<LetBindNode>)
The let bind statement node.
Guard(Box<GuardStatement>)
The guard statement node.
While(Box<WhileLoop>)
The while loop statement node.
For(Box<ForLoop>)
The for loop statement node.
Control(Box<ControlNode>)
The argument argument node.
Expression(Box<ExpressionNode>)
The argument argument node.
Implementations§
source§impl StatementKind
impl StatementKind
sourcepub fn expression(body: ExpressionKind, span: Range<u32>) -> Self
pub fn expression(body: ExpressionKind, span: Range<u32>) -> Self
Create a new expression node
Trait Implementations§
source§impl Clone for StatementKind
impl Clone for StatementKind
source§fn clone(&self) -> StatementKind
fn clone(&self) -> StatementKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for StatementKind
impl Debug for StatementKind
source§impl From<AttributeList> for StatementKind
impl From<AttributeList> for StatementKind
source§fn from(o: AttributeList) -> Self
fn from(o: AttributeList) -> Self
Converts to this type from the input type.
source§impl From<ClassDeclaration> for StatementKind
impl From<ClassDeclaration> for StatementKind
source§fn from(o: ClassDeclaration) -> Self
fn from(o: ClassDeclaration) -> Self
Converts to this type from the input type.
source§impl From<ControlNode> for StatementKind
impl From<ControlNode> for StatementKind
source§fn from(o: ControlNode) -> Self
fn from(o: ControlNode) -> Self
Converts to this type from the input type.
source§impl From<DocumentationList> for StatementKind
impl From<DocumentationList> for StatementKind
source§fn from(o: DocumentationList) -> Self
fn from(o: DocumentationList) -> Self
Converts to this type from the input type.
source§impl From<ExpressionNode> for StatementKind
impl From<ExpressionNode> for StatementKind
source§fn from(o: ExpressionNode) -> Self
fn from(o: ExpressionNode) -> Self
Converts to this type from the input type.
source§impl From<ExtendsStatement> for StatementKind
impl From<ExtendsStatement> for StatementKind
source§fn from(o: ExtendsStatement) -> Self
fn from(o: ExtendsStatement) -> Self
Converts to this type from the input type.
source§impl From<FlagDeclaration> for StatementKind
impl From<FlagDeclaration> for StatementKind
source§fn from(o: FlagDeclaration) -> Self
fn from(o: FlagDeclaration) -> Self
Converts to this type from the input type.
source§impl From<ForLoop> for StatementKind
impl From<ForLoop> for StatementKind
source§impl From<FunctionDeclaration> for StatementKind
impl From<FunctionDeclaration> for StatementKind
source§fn from(o: FunctionDeclaration) -> Self
fn from(o: FunctionDeclaration) -> Self
Converts to this type from the input type.
source§impl From<GuardStatement> for StatementKind
impl From<GuardStatement> for StatementKind
source§fn from(o: GuardStatement) -> Self
fn from(o: GuardStatement) -> Self
Converts to this type from the input type.
source§impl From<ImportStatement> for StatementKind
impl From<ImportStatement> for StatementKind
source§fn from(o: ImportStatement) -> Self
fn from(o: ImportStatement) -> Self
Converts to this type from the input type.
source§impl From<LetBindNode> for StatementKind
impl From<LetBindNode> for StatementKind
source§fn from(o: LetBindNode) -> Self
fn from(o: LetBindNode) -> Self
Converts to this type from the input type.
source§impl From<NamespaceDeclaration> for StatementKind
impl From<NamespaceDeclaration> for StatementKind
source§fn from(o: NamespaceDeclaration) -> Self
fn from(o: NamespaceDeclaration) -> Self
Converts to this type from the input type.
source§impl From<TraitDeclaration> for StatementKind
impl From<TraitDeclaration> for StatementKind
source§fn from(o: TraitDeclaration) -> Self
fn from(o: TraitDeclaration) -> Self
Converts to this type from the input type.
source§impl From<UnionDeclaration> for StatementKind
impl From<UnionDeclaration> for StatementKind
source§fn from(o: UnionDeclaration) -> Self
fn from(o: UnionDeclaration) -> Self
Converts to this type from the input type.
source§impl From<WhileLoop> for StatementKind
impl From<WhileLoop> for StatementKind
source§impl Hash for StatementKind
impl Hash for StatementKind
source§impl PartialEq for StatementKind
impl PartialEq for StatementKind
source§fn eq(&self, other: &StatementKind) -> bool
fn eq(&self, other: &StatementKind) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for StatementKind
impl StructuralPartialEq for StatementKind
Auto Trait Implementations§
impl RefUnwindSafe for StatementKind
impl Send for StatementKind
impl Sync for StatementKind
impl Unpin for StatementKind
impl UnwindSafe for StatementKind
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