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:
4
projects/custom_fn.j
Normal file
4
projects/custom_fn.j
Normal file
@@ -0,0 +1,4 @@
|
||||
fn greet(name):
|
||||
println("Hola, " + name)
|
||||
|
||||
greet("mundo!")
|
||||
Reference in New Issue
Block a user