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

Method repeat

src/codegen/stmt.rs:42–59  ·  view source on GitHub ↗
(
        &mut self,
        s: S,
        d: D,
        this_id: NodeID,
        times: &Expr,
        body: &[Stmt],
    )

Source from the content-addressed store, hash-verified

40where T: Write + Seek
41{
42 pub fn repeat(
43 &mut self,
44 s: S,
45 d: D,
46 this_id: NodeID,
47 times: &Expr,
48 body: &[Stmt],
49 ) -> io::Result<()> {
50 let times_id = self.id.new_id();
51 let body_id = self.id.new_id();
52 self.begin_inputs()?;
53 self.input(s, d, "TIMES", times, times_id)?;
54 self.substack("SUBSTACK", (!body.is_empty()).then_some(body_id))?;
55 self.end_obj()?; // inputs
56 self.end_obj()?; // node
57 self.expr(s, d, times, times_id, this_id)?;
58 self.stmts(s, d, body, body_id, Some(this_id))
59 }
60
61 pub fn forever(
62 &mut self,

Callers 1

stmtMethod · 0.80

Calls 7

new_idMethod · 0.80
begin_inputsMethod · 0.80
substackMethod · 0.80
end_objMethod · 0.80
exprMethod · 0.80
stmtsMethod · 0.80
inputMethod · 0.45

Tested by

no test coverage detected