From 1468c636ee2bab294e085103f2cff749c26c0dd9 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Fri, 8 May 2026 23:26:32 +0200 Subject: [PATCH] refactor(extract): rename ts_node_stack.h to extract_node_stack.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pure rename — no logic change. The header is consumed only by internal/cbm/extract_*.c, depends on tree_sitter/api.h, and is purpose- built for AST traversal during extraction. The "extract_" prefix makes the scope explicit and keeps the file naming consistent with its neighbours (extract_calls.c, extract_imports.c, ...). - internal/cbm/ts_node_stack.h -> internal/cbm/extract_node_stack.h - Include guard CBM_TS_NODE_STACK_H -> CBM_EXTRACT_NODE_STACK_H - Header banner comment updated - 9 call sites in internal/cbm/extract_*.c updated to the new path Full suite: 2824 passed, 0 failed. --- internal/cbm/extract_calls.c | 2 +- internal/cbm/extract_channels.c | 2 +- internal/cbm/extract_defs.c | 2 +- internal/cbm/extract_env_accesses.c | 2 +- internal/cbm/extract_imports.c | 2 +- internal/cbm/{ts_node_stack.h => extract_node_stack.h} | 8 ++++---- internal/cbm/extract_semantic.c | 2 +- internal/cbm/extract_type_assigns.c | 2 +- internal/cbm/extract_type_refs.c | 2 +- internal/cbm/extract_usages.c | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) rename internal/cbm/{ts_node_stack.h => extract_node_stack.h} (90%) diff --git a/internal/cbm/extract_calls.c b/internal/cbm/extract_calls.c index ef6bb9baa..8f69b68ea 100644 --- a/internal/cbm/extract_calls.c +++ b/internal/cbm/extract_calls.c @@ -4,7 +4,7 @@ #include "lang_specs.h" #include "extract_unified.h" #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include // uint32_t #include diff --git a/internal/cbm/extract_channels.c b/internal/cbm/extract_channels.c index 5db1396da..2c20838b8 100644 --- a/internal/cbm/extract_channels.c +++ b/internal/cbm/extract_channels.c @@ -24,7 +24,7 @@ #include "arena.h" #include "helpers.h" #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include "tree_sitter/api.h" #include #include diff --git a/internal/cbm/extract_defs.c b/internal/cbm/extract_defs.c index c9acd6c86..d86a58a2f 100644 --- a/internal/cbm/extract_defs.c +++ b/internal/cbm/extract_defs.c @@ -3,7 +3,7 @@ #include "helpers.h" #include "lang_specs.h" #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include "simhash/minhash.h" #include "semantic/ast_profile.h" #include "tree_sitter/api.h" // TSNode, ts_node_* diff --git a/internal/cbm/extract_env_accesses.c b/internal/cbm/extract_env_accesses.c index 03e7c0c10..9a12411a5 100644 --- a/internal/cbm/extract_env_accesses.c +++ b/internal/cbm/extract_env_accesses.c @@ -4,7 +4,7 @@ #include "lang_specs.h" #include "extract_unified.h" #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include // uint32_t #include diff --git a/internal/cbm/extract_imports.c b/internal/cbm/extract_imports.c index 4e44d33ac..c4e3112d8 100644 --- a/internal/cbm/extract_imports.c +++ b/internal/cbm/extract_imports.c @@ -4,7 +4,7 @@ #include "lang_specs.h" // CBMLangSpec, CBMEmbeddedLangSpec, cbm_lang_spec, cbm_ts_language #include "tree_sitter/api.h" // TSNode, ts_node_* #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include // uint32_t #include #include diff --git a/internal/cbm/ts_node_stack.h b/internal/cbm/extract_node_stack.h similarity index 90% rename from internal/cbm/ts_node_stack.h rename to internal/cbm/extract_node_stack.h index db6588e6d..bb7b183b4 100644 --- a/internal/cbm/ts_node_stack.h +++ b/internal/cbm/extract_node_stack.h @@ -1,5 +1,5 @@ /* - * ts_node_stack.h — Growable TSNode stack for AST traversal. + * extract_node_stack.h — Growable TSNode stack for AST traversal. * * Replaces fixed-size TSNode stack[] arrays that silently drop AST subtrees * when the stack overflows (GitHub issue #199). @@ -9,8 +9,8 @@ * Initial capacity matches the previous fixed caps so small files allocate * no extra memory. */ -#ifndef CBM_TS_NODE_STACK_H -#define CBM_TS_NODE_STACK_H +#ifndef CBM_EXTRACT_NODE_STACK_H +#define CBM_EXTRACT_NODE_STACK_H #include "arena.h" #include "tree_sitter/api.h" @@ -50,4 +50,4 @@ static inline TSNode ts_nstack_pop(TSNodeStack *s) { return s->items[--s->count]; } -#endif /* CBM_TS_NODE_STACK_H */ +#endif /* CBM_EXTRACT_NODE_STACK_H */ diff --git a/internal/cbm/extract_semantic.c b/internal/cbm/extract_semantic.c index 17e1ebe47..324c500da 100644 --- a/internal/cbm/extract_semantic.c +++ b/internal/cbm/extract_semantic.c @@ -5,7 +5,7 @@ #include "extract_unified.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" enum { MAX_EXCEPTION_NAME_LEN = 100, LAST_IDX = 1 }; #include // uint32_t diff --git a/internal/cbm/extract_type_assigns.c b/internal/cbm/extract_type_assigns.c index bd7328eda..c363c7645 100644 --- a/internal/cbm/extract_type_assigns.c +++ b/internal/cbm/extract_type_assigns.c @@ -5,7 +5,7 @@ #include "extract_unified.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" #include // uint32_t #include #include diff --git a/internal/cbm/extract_type_refs.c b/internal/cbm/extract_type_refs.c index 3960d1e1a..8f78101f4 100644 --- a/internal/cbm/extract_type_refs.c +++ b/internal/cbm/extract_type_refs.c @@ -5,7 +5,7 @@ #include "extract_unified.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" enum { MIN_TYPE_LEN = 1 }; diff --git a/internal/cbm/extract_usages.c b/internal/cbm/extract_usages.c index e52345f3c..16105dce9 100644 --- a/internal/cbm/extract_usages.c +++ b/internal/cbm/extract_usages.c @@ -4,7 +4,7 @@ #include "extract_unified.h" #include "tree_sitter/api.h" // TSNode, ts_node_* #include "foundation/constants.h" -#include "ts_node_stack.h" +#include "extract_node_stack.h" enum { MAX_PARENT_DEPTH = 10, LAST_IDX = 1 }; #include // uint32_t