Add branching and more coherent method of function calls
We're turing-complete, babey! * Call stack for functions now differentiates between native and quote calls * Better API for builtin functions allowing for more control * Example showing off branches Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::object::{QuoteTable, Value};
|
||||
use crate::scope::*;
|
||||
use crate::syn::ast::*;
|
||||
use crate::vm::inst::*;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct Compile<'s> {
|
||||
scope_stack: &'s mut ScopeStack,
|
||||
@@ -35,7 +36,7 @@ impl<'s> Compile<'s> {
|
||||
// this gets compiled whenever it gets evaluated
|
||||
Expr::Quote(exprs) => {
|
||||
self.scope_stack.push_scope();
|
||||
let compiled = self.compile(exprs);
|
||||
let compiled = Rc::new(self.compile(exprs));
|
||||
let locals = self.scope_stack.pop_scope().unwrap();
|
||||
let quote = self
|
||||
.quote_table
|
||||
|
||||
Reference in New Issue
Block a user