Add user-defined functions with call frames

Implement fn/return across the full pipeline:
- Lexer: TOK_FN, TOK_RETURN keywords
- Parser: NODE_FN_DEF, NODE_RETURN AST nodes
- Compiler: FunctionEntry table, inline compilation with jump-over and backpatching
- VM: CallFrame stack with variable snapshot for scoped calls and OP_RETURN
This commit is contained in:
Jose Luis Montañes Ojados
2026-02-18 03:16:54 +01:00
parent da9bb6ca62
commit f2e90efc16
6 changed files with 421 additions and 191 deletions

4
projects/custom_fn.j Normal file
View File

@@ -0,0 +1,4 @@
fn greet(name):
println("Hola, " + name)
greet("mundo!")