| Age | Commit message (Collapse) | Author |
|
|
|
Two bugs combined to break uber.fy and any function called more than once:
1. Scanner split identifiers at '_' boundaries (e.g. arr_sum → arr + _sum).
Fixed by adding d != '_' to the token-splitting guard condition so
underscores are treated as part of identifiers.
2. Dead keyword TT_ARR reserved the name 'arr' as a keyword token,
preventing its use as a function parameter. Removed TT_ARR from the
enum, keyword table, and name table.
3. (Root cause of the assert failure) _var_assign stored the symbol for a
newly declared variable pointing directly at the literal token from the
function body token list. incr/decr modify tokens in place via
stack_top, so a loop like `my i = 0; while i < n { incr i; }` would
corrupt the body's '0' literal — on the next call i starts at 10 instead
of 0. Fixed by allocating a fresh token_new_integer / token_new_dummy
for TT_INTEGER and TT_DOUBLE initialisers so body literals are never
mutated. Arrays and strings retain reference semantics unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
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 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run "make headers"
|
|
more BSD style in return (FOO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|