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

Method first_arg_value

codegraph-kernel/src/rlang.rs:266–276  ·  view source on GitHub ↗

firstArgValue (r.ts:58-67): the FIRST `argument`-typed named child of the `arguments` field → its `value` field (named arguments are NOT skipped — `library(help = docpkg)` imports "docpkg", preserved bug).

(&self, call: Node<'t>)

Source from the content-addressed store, hash-verified

264 /// the `arguments` field → its `value` field (named arguments are NOT
265 /// skipped — `library(help = docpkg)` imports "docpkg", preserved bug).
266 fn first_arg_value(&self, call: Node<'t>) -> Option<Node<'t>> {
267 let args = call.child_by_field_name("arguments")?;
268 let mut cursor = args.walk();
269 for arg in args.named_children(&mut cursor) {
270 if arg.kind() != "argument" {
271 continue;
272 }
273 return arg.child_by_field_name("value");
274 }
275 None
276 }
277
278 /// literalOrIdentifier (r.ts:70-81): identifier text (backticks kept), a
279 /// string's first string_content text, `Some("")` for an empty string

Callers 1

hook_callMethod · 0.80

Calls 1

walkMethod · 0.80

Tested by

no test coverage detected