From 2a2227d529f3788b8e08752d37deb1a449f3b9bc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 28 Feb 2026 16:15:57 +0200 Subject: Clean up scanner_run() and interpret_run(): narrow signatures, fix SoC [SoC/DIP] Three issues resolved: 1. scanner_run() no longer takes Fype*. New signature: scanner_run(List*, Tupel*, char **c_filename_out) Verbose-mode list_iterate() and basename extraction moved to fype_run() (the composition root), leaving scanner_run() as pure tokenizer: open source -> tokenize -> post-process -> return filename. 2. interpret_run() no longer takes Fype*. New signature: interpret_run(List *p_list_token, Hash *p_hash_syms) Fype* unpacking happens in fype_run(); interpret.h no longer includes fype.h. scanner.h no longer includes fype.h either. 3. _CODESTR_INDEX file-global (which made the scanner non-reentrant) moved into the Scanner struct as i_codestr_index, initialized to 0 in scanner_new(). _scanner_has_next_char() and _scanner_get_next_char() use p_scanner->i_codestr_index instead. Co-Authored-By: Claude Sonnet 4.6 --- src/core/interpret.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/core/interpret.c') diff --git a/src/core/interpret.c b/src/core/interpret.c index b6c7c33..ba0eade 100644 --- a/src/core/interpret.c +++ b/src/core/interpret.c @@ -1352,13 +1352,11 @@ interpret_subprocess(Interpret *p_interpret, List *p_list_token) { return (i_ret); } +/* Create an interpreter, run it over the token list, then tear it down. */ void -interpret_run(Fype *p_fype) { - Interpret *p_interpret = - interpret_new(p_fype->p_list_token, p_fype->p_hash_syms); - +interpret_run(List *p_list_token, Hash *p_hash_syms) { + Interpret *p_interpret = interpret_new(p_list_token, p_hash_syms); interpret_process(p_interpret); - interpret_delete(p_interpret); } -- cgit v1.2.3