MCPcopy Create free account
hub / github.com/aspizu/goboscript / stmt

Method stmt

src/codegen/sb3.rs:1108–1172  ·  view source on GitHub ↗
(
        &mut self,
        s: S,
        d: D,
        stmt: &Stmt,
        this_id: NodeID,
        next_id: Option<NodeID>,
        parent_id: Option<NodeID>,
    )

Source from the content-addressed store, hash-verified

1106 }
1107
1108 pub fn stmt(
1109 &mut self,
1110 s: S,
1111 d: D,
1112 stmt: &Stmt,
1113 this_id: NodeID,
1114 next_id: Option<NodeID>,
1115 parent_id: Option<NodeID>,
1116 ) -> io::Result<()> {
1117 self.begin_node(
1118 Node::new(stmt.opcode(s), this_id)
1119 .some_next_id(next_id)
1120 .some_parent_id(parent_id),
1121 )?;
1122 match stmt {
1123 Stmt::Repeat { times, body } => self.repeat(s, d, this_id, times, body),
1124 Stmt::Forever { body, span } => self.forever(s, d, this_id, body, span),
1125 Stmt::Branch {
1126 cond,
1127 if_body,
1128 else_body,
1129 } => self.branch(s, d, this_id, cond, if_body, else_body),
1130 Stmt::Until { cond, body } => self.until(s, d, this_id, cond, body),
1131 Stmt::SetVar {
1132 name,
1133 value,
1134 type_,
1135 is_local,
1136 is_cloud,
1137 } => self.set_var(s, d, this_id, name, value, type_, is_local, is_cloud),
1138 Stmt::ChangeVar { name, value } => self.change_var(s, d, this_id, name, value),
1139 Stmt::Show(name) => self.show(s, d, name),
1140 Stmt::Hide(name) => self.hide(s, d, name),
1141 Stmt::AddToList { name, value } => self.add_to_list(s, d, this_id, name, value),
1142 Stmt::DeleteListIndex { name, index } => {
1143 self.delete_list_index(s, d, this_id, name, index)
1144 }
1145 Stmt::DeleteList(name) => self.delete_list(s, d, name),
1146 Stmt::InsertAtList { name, index, value } => {
1147 self.list_insert(s, d, this_id, name, index, value)
1148 }
1149 Stmt::SetListIndex { name, index, value } => {
1150 self.set_list_index(s, d, this_id, name, index, value)
1151 }
1152 Stmt::Block {
1153 block,
1154 span,
1155 args,
1156 kwargs: _,
1157 } => self.block(s, d, this_id, block, span, args),
1158 Stmt::ProcCall {
1159 name,
1160 span,
1161 args,
1162 kwargs: _,
1163 } => self.proc_call(s, d, this_id, name, span, args),
1164 Stmt::FuncCall {
1165 name,

Callers 1

stmtsMethod · 0.80

Calls 15

newFunction · 0.85
begin_nodeMethod · 0.80
some_parent_idMethod · 0.80
some_next_idMethod · 0.80
repeatMethod · 0.80
foreverMethod · 0.80
branchMethod · 0.80
untilMethod · 0.80
set_varMethod · 0.80
change_varMethod · 0.80
showMethod · 0.80
hideMethod · 0.80

Tested by

no test coverage detected