MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / visit_body

Method visit_body

codegraph-kernel/src/dart.rs:1246–1278  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1244 // --- visitFunctionBody (:5129-5286) — dart rows -----------------------
1245
1246 fn visit_body(&mut self, node: Node<'t>) {
1247 stack_guard!();
1248 self.maybe_capture_fn_refs(node);
1249
1250 let kind = node.kind();
1251 if kind == "new_expression" {
1252 // INSTANTIATION branch fires first — extractBareCall's
1253 // new_expression arm is dead. Children still recursed.
1254 self.extract_instantiation(node);
1255 } else if let Some(callee) = self.bare_call_name(node) {
1256 // extractBareCall (:5159-5173) — ref at the MATCHED node.
1257 if !self.stack.is_empty() {
1258 let caller_row = self.top_row();
1259 self.push_ref_at(caller_row, &callee, "calls", node);
1260 }
1261 }
1262
1263 self.extract_static_member_ref(node);
1264
1265 if kind == "function_signature" {
1266 // Nested named functions (:5245) — extractFunction walks the
1267 // nested body itself; the enclosing walker ALSO revisits the
1268 // sibling function_body (double-walk pass 2b) via recursion.
1269 self.extract_function(node);
1270 return;
1271 }
1272
1273 let mut cursor = node.walk();
1274 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
1275 for child in children {
1276 self.visit_body(child);
1277 }
1278 }
1279
1280 // --- function-as-value capture (#756) — DART_SPEC ---------------------
1281

Callers 2

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 8

maybe_capture_fn_refsMethod · 0.45
extract_instantiationMethod · 0.45
bare_call_nameMethod · 0.45
top_rowMethod · 0.45
push_ref_atMethod · 0.45
extract_functionMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected