summaryrefslogtreecommitdiff
path: root/src/core/symbol.c
AgeCommit message (Collapse)Author
2026-02-28modify headersHEADmasterPaul Buetow
2026-02-19Implement function named arguments, ret, and multiple return valuesPaul Buetow
- Add FuncDef struct to symbol.h/symbol.c: holds body token list, strdup'd param names, and param count; replaces the bare List* that SYM_FUNCTION used to store; funcdef_delete frees param strings and body list (tokens are GC-managed) - Add CONTROL_RET to ControlType so ret can propagate cleanly through the interpreter's control-flow stack - Update _func_decl to parse optional (p1, p2, ...) param list and store a FuncDef* instead of a raw List* - Implement case TT_RET in _control: clears intermediate stack values, evaluates comma-separated return expressions, sets CONTROL_RET - Propagate CONTROL_RET in all loop bodies (while/until, loop, do) without clearing it; while/until rescues return values from the temporary condition stack before it is destroyed - Update _term call site to support parenthesised func(arg1, arg2) syntax alongside the existing no-parens style for backward compat - Modify interpret_subprocess to merge the sub's stack into the parent when CONTROL_RET is active so return values survive teardown - Update function_process_self_defined SYM_FUNCTION case to pop and bind named args, run the body, then clear CONTROL_RET - Add -D_POSIX_C_SOURCE=200809L to Makefile CFLAGS for strdup under -std=c99 -pedantic - Add examples/func_args_ret.fy covering zero-arg, single-arg, two-arg, conditional ret, multiple return values, and old-style no-parens backward compat Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2021-11-02move to codebergPaul Buetow
2021-04-29update URIsPaul Buetow
2008-12-15modified headersPaul Buetow
2008-12-15say foo[1] worksPaul Buetow
2008-11-09changed the src headers.Paul Buetow
2008-11-04astylePaul Buetow
2008-11-04array_new_sizePaul Buetow
array_new_copy implemented
2008-11-01modified headersPaul Buetow
2008-10-28initial references support.Paul Buetow
run "make headers"
2008-10-26added the "scope" functionPaul Buetow
2008-10-25astyle.Paul Buetow
more BSD style in return (FOO);
2008-10-25make headersPaul Buetow
2008-10-20Improved GC debugging.Paul Buetow
Debugging printings now labeled with DEBUG::$NAME::$ETC::..:
2008-10-19synonyms workPaul Buetow
2008-10-18backdowngradePaul Buetow
2008-10-14GC removed, temporalyPaul Buetow
2008-09-16array progressPaul Buetow
2008-08-24some modsPaul Buetow
2008-08-23changed headersPaul Buetow
2008-08-23some enhancementsPaul Buetow
2008-08-08changed header.Paul Buetow
2008-05-15Moved stuff into trunk.Paul Buetow