Enum sway_core::language::parsed::AstNodeContent
source · pub enum AstNodeContent {
UseStatement(UseStatement),
Declaration(Declaration),
Expression(Expression),
ImplicitReturnExpression(Expression),
IncludeStatement(IncludeStatement),
}
Expand description
Represents the various structures that constitute a Sway program.
Variants§
UseStatement(UseStatement)
A statement of the form use foo::bar;
or use ::foo::bar;
Declaration(Declaration)
Any type of declaration, of which there are quite a few. See Declaration for more details on the possible variants.
Expression(Expression)
Any type of expression, of which there are quite a few. See Expression for more details.
ImplicitReturnExpression(Expression)
An implicit return expression is different from a [AstNodeContent::ReturnStatement] because it is not a control flow item. Therefore it is a different variant.
An implicit return expression is an Expression at the end of a code block which has no semicolon, denoting that it is the Expression to be returned from that block.
IncludeStatement(IncludeStatement)
A statement of the form dep foo::bar;
which imports/includes another source file.
Trait Implementations§
source§impl Clone for AstNodeContent
impl Clone for AstNodeContent
source§fn clone(&self) -> AstNodeContent
fn clone(&self) -> AstNodeContent
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 more