Enum scilla_parser::ast::nodes::NodeStatement
source · pub enum NodeStatement {
Show 16 variants
Load {
left_hand_side: WithMetaData<String>,
right_hand_side: WithMetaData<NodeVariableIdentifier>,
},
RemoteFetch(Box<NodeRemoteFetchStatement>),
Store {
left_hand_side: WithMetaData<String>,
right_hand_side: WithMetaData<NodeVariableIdentifier>,
},
Bind {
left_hand_side: WithMetaData<String>,
right_hand_side: Box<WithMetaData<NodeFullExpression>>,
},
ReadFromBC {
left_hand_side: WithMetaData<String>,
type_name: WithMetaData<NodeTypeNameIdentifier>,
arguments: Option<NodeBlockchainFetchArguments>,
},
MapGet {
left_hand_side: WithMetaData<String>,
keys: Vec<WithMetaData<NodeMapAccess>>,
right_hand_side: WithMetaData<String>,
},
MapGetExists {
left_hand_side: WithMetaData<String>,
keys: Vec<WithMetaData<NodeMapAccess>>,
right_hand_side: WithMetaData<String>,
},
MapUpdate {
left_hand_side: WithMetaData<String>,
keys: Vec<WithMetaData<NodeMapAccess>>,
right_hand_side: WithMetaData<NodeVariableIdentifier>,
},
MapUpdateDelete {
left_hand_side: WithMetaData<String>,
keys: Vec<WithMetaData<NodeMapAccess>>,
},
Accept,
Send {
identifier_name: WithMetaData<NodeVariableIdentifier>,
},
CreateEvnt {
identifier_name: WithMetaData<NodeVariableIdentifier>,
},
Throw {
error_variable: Option<WithMetaData<NodeVariableIdentifier>>,
},
MatchStmt {
variable: WithMetaData<NodeVariableIdentifier>,
clauses: Vec<WithMetaData<NodePatternMatchClause>>,
},
CallProc {
component_id: WithMetaData<NodeComponentId>,
arguments: Vec<WithMetaData<NodeVariableIdentifier>>,
},
Iterate {
identifier_name: WithMetaData<NodeVariableIdentifier>,
component_id: WithMetaData<NodeComponentId>,
},
}Expand description
NodeStatement represents a statement node in the AST It can be one of many different types of statements
Variants§
Load
Represents a load statement
Example: load x;
RemoteFetch(Box<NodeRemoteFetchStatement>)
Represents a remote fetch statement
Example: fetch x from remote;
Store
Represents a store statement
Example: store x;
Bind
Represents a bind statement
Example: bind x = y;
ReadFromBC
Fields
left_hand_side: WithMetaData<String>type_name: WithMetaData<NodeTypeNameIdentifier>arguments: Option<NodeBlockchainFetchArguments>Represents a read from blockchain statement
Example: read x from bc;
MapGet
Fields
left_hand_side: WithMetaData<String>keys: Vec<WithMetaData<NodeMapAccess>>right_hand_side: WithMetaData<String>Represents a map get statement
Example: get x from map;
MapGetExists
Fields
left_hand_side: WithMetaData<String>keys: Vec<WithMetaData<NodeMapAccess>>right_hand_side: WithMetaData<String>Represents a map get exists statement
Example: get x from map if exists;
MapUpdate
Fields
left_hand_side: WithMetaData<String>keys: Vec<WithMetaData<NodeMapAccess>>right_hand_side: WithMetaData<NodeVariableIdentifier>Represents a map update statement
Example: update x in map;
MapUpdateDelete
Represents a map update delete statement
Example: delete x from map;
Accept
Represents an accept statement
Example: accept;
Send
Fields
identifier_name: WithMetaData<NodeVariableIdentifier>Represents a send statement
Example: send x;
CreateEvnt
Fields
identifier_name: WithMetaData<NodeVariableIdentifier>Represents a create event statement
Example: create event x;
Throw
Fields
error_variable: Option<WithMetaData<NodeVariableIdentifier>>Represents a throw statement
Example: throw x;
MatchStmt
Fields
variable: WithMetaData<NodeVariableIdentifier>clauses: Vec<WithMetaData<NodePatternMatchClause>>Represents a match statement
Example: match x with | Nil => "nil" | Cons a b => "cons" end
CallProc
Fields
component_id: WithMetaData<NodeComponentId>arguments: Vec<WithMetaData<NodeVariableIdentifier>>Represents a call procedure statement
Example: call proc x;
Iterate
Fields
identifier_name: WithMetaData<NodeVariableIdentifier>component_id: WithMetaData<NodeComponentId>Represents an iterate statement
Example: iterate x over y;
Trait Implementations§
source§impl AstVisitor for NodeStatement
impl AstVisitor for NodeStatement
fn visit( &self, emitter: &mut dyn AstConverting ) -> Result<TraversalResult, String>
source§impl Clone for NodeStatement
impl Clone for NodeStatement
source§fn clone(&self) -> NodeStatement
fn clone(&self) -> NodeStatement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for NodeStatement
impl Debug for NodeStatement
source§impl PartialEq for NodeStatement
impl PartialEq for NodeStatement
source§fn eq(&self, other: &NodeStatement) -> bool
fn eq(&self, other: &NodeStatement) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NodeStatement
impl PartialOrd for NodeStatement
source§fn partial_cmp(&self, other: &NodeStatement) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeStatement) -> 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