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

Method stmts

src/codegen/sb3.rs:1083–1106  ·  view source on GitHub ↗
(
        &mut self,
        s: S,
        d: D,
        stmts: &[Stmt],
        mut this_id: NodeID,
        mut parent_id: Option<NodeID>,
    )

Source from the content-addressed store, hash-verified

1081 }
1082
1083 pub fn stmts(
1084 &mut self,
1085 s: S,
1086 d: D,
1087 stmts: &[Stmt],
1088 mut this_id: NodeID,
1089 mut parent_id: Option<NodeID>,
1090 ) -> io::Result<()> {
1091 for (i, stmt) in stmts.iter().enumerate() {
1092 let is_last = i == stmts.len() - 1;
1093 if is_last || stmt.is_terminator() {
1094 self.stmt(s, d, stmt, this_id, None, parent_id)?;
1095 if !is_last {
1096 d.report(DiagnosticKind::FollowedByUnreachableCode, stmt.span());
1097 }
1098 break;
1099 }
1100 let next_id = self.id.new_id();
1101 self.stmt(s, d, stmt, this_id, Some(next_id), parent_id)?;
1102 parent_id = Some(this_id);
1103 this_id = next_id;
1104 }
1105 Ok(())
1106 }
1107
1108 pub fn stmt(
1109 &mut self,

Callers 7

repeatMethod · 0.80
foreverMethod · 0.80
branchMethod · 0.80
untilMethod · 0.80
procMethod · 0.80
funcMethod · 0.80
eventMethod · 0.80

Calls 5

is_terminatorMethod · 0.80
stmtMethod · 0.80
reportMethod · 0.80
new_idMethod · 0.80
spanMethod · 0.45

Tested by

no test coverage detected