MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / oa_mapping

Function oa_mapping

internal/cbm/openapi.c:42–62  ·  view source on GitHub ↗

The mapping a node holds (a YAML block or flow mapping, a JSON object), * through the wrappers around it; a null node for none. */

Source from the content-addressed store, hash-verified

40/* The mapping a node holds (a YAML block or flow mapping, a JSON object),
41 * through the wrappers around it; a null node for none. */
42static TSNode oa_mapping(TSNode n) {
43 for (int k = 0; k < OA_UNWRAP_MAX && !ts_node_is_null(n); k++) {
44 if (oa_is(n, "block_mapping") || oa_is(n, "flow_mapping") || oa_is(n, "object")) {
45 return n;
46 }
47 if (!oa_is(n, "stream") && !oa_is(n, "document") && !oa_is(n, "block_node") &&
48 !oa_is(n, "flow_node")) {
49 break;
50 }
51 TSNode next = {0};
52 uint32_t nc = ts_node_named_child_count(n);
53 for (uint32_t i = 0; i < nc && ts_node_is_null(next); i++) {
54 TSNode c = ts_node_named_child(n, i);
55 if (!oa_is(c, "comment") && !oa_is(c, "anchor") && !oa_is(c, "tag")) {
56 next = c;
57 }
58 }
59 n = next;
60 }
61 return (TSNode){0};
62}
63
64static bool oa_pair(TSNode n) {
65 return oa_is(n, "block_mapping_pair") || oa_is(n, "flow_pair") || oa_is(n, "pair");

Callers 2

oa_scalarFunction · 0.85
cbm_extract_openapiFunction · 0.85

Calls 1

oa_isFunction · 0.85

Tested by

no test coverage detected