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

Method first_arg_value

codegraph-kernel/src/rlang.rs:263–273  ·  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

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

Callers 1

hook_callMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected