MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / first_sym

Method first_sym

src/extraction/clojure_extractor.rs:395–409  ·  view source on GitHub ↗

Returns the text of the first `sym_lit` child.

(state: &ExtractionState, node: TsNode<'_>)

Source from the content-addressed store, hash-verified

393
394 /// Returns the text of the first `sym_lit` child.
395 fn first_sym(state: &ExtractionState, node: TsNode<'_>) -> Option<String> {
396 let mut cursor = node.walk();
397 if cursor.goto_first_child() {
398 loop {
399 let child = cursor.node();
400 if child.kind() == "sym_lit" {
401 return Some(state.node_text(child));
402 }
403 if !cursor.goto_next_sibling() {
404 break;
405 }
406 }
407 }
408 None
409 }
410
411 /// Returns the text of the Nth `sym_lit` child (0-indexed among named children).
412 fn nth_sym(state: &ExtractionState, node: TsNode<'_>, n: usize) -> Option<String> {

Callers

nothing calls this directly

Calls 2

kindMethod · 0.80
node_textMethod · 0.45

Tested by

no test coverage detected