Enum scilla_parser::ast::nodes::NodeFullExpression
source · pub enum NodeFullExpression {
LocalVariableDeclaration {
identifier_name: WithMetaData<String>,
expression: Box<WithMetaData<NodeFullExpression>>,
type_annotation: Option<WithMetaData<NodeTypeAnnotation>>,
containing_expression: Box<WithMetaData<NodeFullExpression>>,
},
FunctionDeclaration {
identier_value: WithMetaData<String>,
type_annotation: WithMetaData<NodeTypeAnnotation>,
expression: Box<WithMetaData<NodeFullExpression>>,
},
FunctionCall {
function_name: WithMetaData<NodeVariableIdentifier>,
argument_list: Vec<WithMetaData<NodeVariableIdentifier>>,
},
ExpressionAtomic(Box<WithMetaData<NodeAtomicExpression>>),
ExpressionBuiltin {
b: WithMetaData<String>,
targs: Option<WithMetaData<NodeContractTypeArguments>>,
xs: WithMetaData<NodeBuiltinArguments>,
},
Message(Vec<WithMetaData<NodeMessageEntry>>),
Match {
match_expression: WithMetaData<NodeVariableIdentifier>,
clauses: Vec<WithMetaData<NodePatternMatchExpressionClause>>,
},
ConstructorCall {
identifier_name: WithMetaData<NodeMetaIdentifier>,
contract_type_arguments: Option<WithMetaData<NodeContractTypeArguments>>,
argument_list: Vec<WithMetaData<NodeVariableIdentifier>>,
},
TemplateFunction {
identifier_name: WithMetaData<String>,
expression: Box<WithMetaData<NodeFullExpression>>,
},
TApp {
identifier_name: WithMetaData<NodeVariableIdentifier>,
type_arguments: Vec<WithMetaData<NodeTypeArgument>>,
},
}Expand description
NodeFullExpression represents a full expression node in the AST
Variants§
LocalVariableDeclaration
Fields
identifier_name: WithMetaData<String>expression: Box<WithMetaData<NodeFullExpression>>type_annotation: Option<WithMetaData<NodeTypeAnnotation>>containing_expression: Box<WithMetaData<NodeFullExpression>>Represents a local variable declaration
Example: let x = "variable";
FunctionDeclaration
Fields
identier_value: WithMetaData<String>type_annotation: WithMetaData<NodeTypeAnnotation>expression: Box<WithMetaData<NodeFullExpression>>Represents a function declaration
Example: let f = fun (arg : ArgType) => arg;
FunctionCall
Fields
function_name: WithMetaData<NodeVariableIdentifier>argument_list: Vec<WithMetaData<NodeVariableIdentifier>>Represents a function call
Example: f(arg);
ExpressionAtomic(Box<WithMetaData<NodeAtomicExpression>>)
Represents an atomic expression
Example: let x = "atomic";
ExpressionBuiltin
Represents a built-in expression
Example: let x = builtin f arg;
Message(Vec<WithMetaData<NodeMessageEntry>>)
Represents a message
Example: msg = { _tag : "tag", _recipient : "0x123", _amount : "0", param : "value" };
Match
Fields
match_expression: WithMetaData<NodeVariableIdentifier>clauses: Vec<WithMetaData<NodePatternMatchExpressionClause>>Represents a match expression
Example: match x with | Nil => "nil" | Cons a b => "cons" end
ConstructorCall
Fields
identifier_name: WithMetaData<NodeMetaIdentifier>contract_type_arguments: Option<WithMetaData<NodeContractTypeArguments>>argument_list: Vec<WithMetaData<NodeVariableIdentifier>>Represents a constructor call
Example: let x = CustomType arg;
TemplateFunction
Represents a template function
Example: let x = tfun 'A => fun (arg : 'A) => arg;
TApp
Fields
identifier_name: WithMetaData<NodeVariableIdentifier>type_arguments: Vec<WithMetaData<NodeTypeArgument>>Represents a type application
Example: let x = @CustomType arg;
Trait Implementations§
source§impl AstVisitor for NodeFullExpression
impl AstVisitor for NodeFullExpression
fn visit( &self, emitter: &mut dyn AstConverting ) -> Result<TraversalResult, String>
source§impl Clone for NodeFullExpression
impl Clone for NodeFullExpression
source§fn clone(&self) -> NodeFullExpression
fn clone(&self) -> NodeFullExpression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for NodeFullExpression
impl Debug for NodeFullExpression
source§impl PartialEq for NodeFullExpression
impl PartialEq for NodeFullExpression
source§fn eq(&self, other: &NodeFullExpression) -> bool
fn eq(&self, other: &NodeFullExpression) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NodeFullExpression
impl PartialOrd for NodeFullExpression
source§fn partial_cmp(&self, other: &NodeFullExpression) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeFullExpression) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more