From 5f557ebafb596755cb3047cbdafa6122166c26ac Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 28 Feb 2026 16:08:49 +0200 Subject: 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 --- docs/help.txt | 2 +- docs/stats.txt | 2 +- docs/version.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/help.txt b/docs/help.txt index f4a8e65..fae20f2 100644 --- a/docs/help.txt +++ b/docs/help.txt @@ -1,4 +1,4 @@ -Fype Superalpha Build 9691 +Fype Superalpha Build 9701 (c) Paul C. Buetow (2005 - 2008) -e Executes given code string (see synopses) -h Prints this help diff --git a/docs/stats.txt b/docs/stats.txt index bf4e4cc..47a0f36 100644 --- a/docs/stats.txt +++ b/docs/stats.txt @@ -1,6 +1,6 @@ make[1]: Entering directory '/home/paul/git/fype' ===> Num of C source files : 46 -===> Num of C source lines : 8702 +===> Num of C source lines : 8725 ===> Num of Fype source examples : 19 ===> Num of Fype source lines : 883 make[1]: Leaving directory '/home/paul/git/fype' diff --git a/docs/version.txt b/docs/version.txt index e0f6705..dbb9597 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -Fype Superalpha Build 9691 +Fype Superalpha Build 9701 -- cgit v1.2.3