Implement functions
- Implement function declaration and call - Change the precalculated variable stack positions to contain the offset from the end instead of the absolute position. This is important for passing fun args on the stack - Add the ability to offset the stackframes. This is used to delete the stack where the fun args have been stored before the block executes - Implement exit type for blocks in interpreter. This is used to get the return values and propagate them where needed - Add recursive fibonacci examples
This commit is contained in:
@@ -41,6 +41,8 @@ impl SimpleAstOptimizer {
|
||||
}
|
||||
Statement::Print(expr) => Self::optimize_expr(expr),
|
||||
Statement::Declaration(_, _, expr) => Self::optimize_expr(expr),
|
||||
Statement::FunDeclare(_) => (),
|
||||
Statement::Return(expr) => Self::optimize_expr(expr),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user