| 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>
|
|
- Remove IS_A_FUNCTION/IS_NOT_A_FUNCTION macros from symbol.h: referenced
non-existent SYM_INLINEFUNCTION enum value (latent compile error) and
were never used anywhere in the codebase
- Remove TT_BOOL from TokenType enum: marked "temporarily disabled" but
unused for years; YAGNI
- Remove TT_NOTEQ from TokenType enum: duplicate of TT_NEQ ("!="), never
referenced
- Remove IS_NON_TERMINAL/IS_NOT_NON_TERMINAL macros: referenced
START_NON_TERMINALS/END_NON_TERMINALS sentinels that don't exist in the
enum — would cause compile errors if ever used
- Remove token_new_couble declaration (typo) and token_new_double
implementation: function had no callers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Replace the `func` language keyword with `fun` throughout: update the
scanner's string-to-token mapping, all .fy example scripts, and all
documentation files (.txt, .pod, .tex, .man, .html).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Completes the 'loop, next, break, do' TODO entry — break and next
were landed in the previous commit; this adds the remaining two forms:
- loop { body } — infinite loop; the only exit is break. Simpler than
while/until since there is no condition expression to evaluate.
- do { body } while expr; / do { body } until expr; — post-condition
loop: body always executes at least once, condition is checked at the
bottom of each iteration. Condition tokens are collected until ';'
(mirrors _expression_get but stops at semicolon instead of '{'), then
replayed each iteration using the same temp-stack/temp-iterator
technique as while/until. Both break and next are supported.
Token changes: TT_LOOP and TT_DO added to the keyword enum in token.h,
registered in get_tt() and tt_get_name() in token.c.
Add examples/loop_do.fy; expected output: 5 / 12 / 11 / 5.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array_new_copy
implemented
|
|
|
|
run "make headers"
|
|
|
|
more BSD style in return (FOO);
|
|
|
|
|
|
Debugging printings now labeled with DEBUG::$NAME::$ETC::..:
|
|
|
|
|
|
|
|
still lots of debugging to do.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|