summaryrefslogtreecommitdiff
path: root/tags
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-28 16:08:49 +0200
committerPaul Buetow <paul@buetow.org>2026-02-28 16:08:49 +0200
commit5f557ebafb596755cb3047cbdafa6122166c26ac (patch)
tree38311c31975d8cb9c8b211252c3c0865802d2d90 /tags
parent946fac7d813f6283c18087a46b9e2ee084852c64 (diff)
Refactor _term() by extracting _term_ident(), _term_array_literal(), _term_paren() [SRP]
_term() was ~130 lines mixing literal push, array literal construction, identifier resolution, parenthesized expressions, and defined/undef/syms. Extracted three static helpers: - _term_ident(): resolves TT_IDENT as array access, builtin call, self-defined function/proc call, or variable/procedure (~90 lines; acceptable given the complexity of identifier resolution) - _term_array_literal(): builds an array from [expr, ...] syntax - _term_paren(): evaluates a parenthesised expression and checks ')' _term() is now a ~100-line dispatcher. The defined/undef/syms cases remain inline as they are self-contained ~10-line blocks. Also fixes a latent double-assignment bug in _term_array_literal(): the original `TokenType tt = tt = p_interpret->tt;` is now `= p_interpret->tt;`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tags')
-rw-r--r--tags3
1 files changed, 3 insertions, 0 deletions
diff --git a/tags b/tags
index 15c91fa..97d0b0b 100644
--- a/tags
+++ b/tags
@@ -131,6 +131,9 @@ _statement ./src/core/interpret.c /^_statement(Interpret *p_interpret) {$/;" f t
_sum ./src/core/interpret.c /^_sum(Interpret *p_interpret) {$/;" f typeref:typename:int
_term ./src/core/interpret.c /^_term(Interpret *p_interpret) {$/;" f typeref:typename:int
_term_array_access ./src/core/interpret.c /^_term_array_access(Interpret *p_interpret,$/;" f typeref:typename:int
+_term_array_literal ./src/core/interpret.c /^_term_array_literal(Interpret *p_interpret) {$/;" f typeref:typename:int file:
+_term_ident ./src/core/interpret.c /^_term_ident(Interpret *p_interpret) {$/;" f typeref:typename:int file:
+_term_paren ./src/core/interpret.c /^_term_paren(Interpret *p_interpret) {$/;" f typeref:typename:int file:
_tree_print ./src/data/tree.c /^_tree_print(TreeNode *p_treenode, int i_indent) {$/;" f typeref:typename:void
_tree_print_cb ./src/data/tree.c /^_tree_print_cb(void *p_void, void *p_indent) {$/;" f typeref:typename:void
_tree_print_cb2 ./src/data/tree.c /^_tree_print_cb2(void *p_void, void *p_indent) {$/;" f typeref:typename:void