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

Method list_length

src/codegen/expr.rs:294–311  ·  view source on GitHub ↗
(
        &mut self,
        s: S,
        this_id: NodeID,
        parent_id: NodeID,
        name: &str,
    )

Source from the content-addressed store, hash-verified

292 }
293
294 fn list_length(
295 &mut self,
296 s: S,
297 this_id: NodeID,
298 parent_id: NodeID,
299 name: &str,
300 ) -> io::Result<()> {
301 self.begin_node(Node::new("data_lengthoflist", this_id).parent_id(parent_id))?;
302 let list = s.get_list(name).unwrap();
303 if let Some((type_name, _type_span)) = list.type_.struct_() {
304 let struct_ = s.get_struct(type_name).unwrap();
305 let qualified_name = qualify_struct_var_name(&struct_.fields[0].name, name);
306 self.single_field_id("LIST", &qualified_name)?;
307 } else {
308 self.single_field_id("LIST", name)?;
309 }
310 self.end_obj() // node
311 }
312
313 pub fn func_call(
314 &mut self,

Callers 1

un_opMethod · 0.80

Calls 9

newFunction · 0.85
qualify_struct_var_nameFunction · 0.85
begin_nodeMethod · 0.80
parent_idMethod · 0.80
struct_Method · 0.80
single_field_idMethod · 0.80
end_objMethod · 0.80
get_listMethod · 0.45
get_structMethod · 0.45

Tested by

no test coverage detected