MCPcopy Create free account
hub / github.com/arialang/aria / from_code_object

Method from_code_object

vm-lib/src/runtime_value/function.rs:198–217  ·  view source on GitHub ↗
(co: &CodeObject, a: u8, m: &RuntimeModule)

Source from the content-addressed store, hash-verified

196 }
197
198 pub fn from_code_object(co: &CodeObject, a: u8, m: &RuntimeModule) -> Self {
199 let rc = co.body.clone();
200 let lt = co.line_table.clone();
201 let bcf = BytecodeFunction {
202 name: co.name.clone(),
203 body: rc,
204 arity: Arity {
205 required: co.required_argc,
206 optional: co.default_argc,
207 },
208 frame_size: co.frame_size,
209 line_table: lt,
210 loc: co.loc.clone(),
211 attrib_byte: a,
212 module: m.clone(),
213 boxx: Default::default(),
214 uplevels: Default::default(),
215 };
216 Self::BytecodeFunction(bcf)
217 }
218
219 fn write(&self, name: &str, val: RuntimeValue) {
220 match self {

Callers

nothing calls this directly

Calls 1

BytecodeFunctionClass · 0.85

Tested by

no test coverage detected