MCPcopy Create free account
hub / github.com/borgo-lang/borgo / create_make_function

Method create_make_function

compiler/src/codegen.rs:1585–1596  ·  view source on GitHub ↗
(&mut self, def: &EnumDefinition)

Source from the content-addressed store, hash-verified

1583 }
1584
1585 fn create_make_function(&mut self, def: &EnumDefinition) -> String {
1586 let mut out = emitter();
1587
1588 def.cons.iter().for_each(|con| {
1589 let constructor = def.name.clone() + "." + &con.name;
1590 let name = to_name(&format!("make_{constructor}"));
1591 out.emit(self.constructor_make_function(&def, &name, con));
1592 self.make_functions.insert(constructor, name);
1593 });
1594
1595 out.render()
1596 }
1597
1598 fn emit_wrapped_try(&mut self, ctx: &Ctx, func: &Expr, args: &[Expr]) -> EmitResult {
1599 let mut out = emitter();

Callers 1

Calls 5

emitterFunction · 0.85
to_nameFunction · 0.85
emitMethod · 0.80
renderMethod · 0.80

Tested by

no test coverage detected