Add function compilation
Functions are compiled in the most naiive way right now. I want to fix up how scope lookups are done before it becomes too much to update. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -18,11 +18,11 @@ pub struct UserFun {
|
||||
code: Vec<Inst>,
|
||||
// Safe because this is just an interner that points to symbols, which aren't GC'd
|
||||
#[shredder(unsafe_skip)]
|
||||
locals: Names,
|
||||
locals: Locals,
|
||||
}
|
||||
|
||||
impl UserFun {
|
||||
pub fn new_obj(code: Vec<Inst>, locals: Names) -> UserFunRef {
|
||||
pub fn new_obj(code: Vec<Inst>, locals: Locals) -> UserFunRef {
|
||||
let obj_ref = ObjRef::new(UserFun {
|
||||
vtable: Default::default(), // this is a placeholder for the real vtable
|
||||
attrs: Default::default(),
|
||||
@@ -47,7 +47,7 @@ impl UserFun {
|
||||
&self.code
|
||||
}
|
||||
|
||||
pub fn locals(&self) -> &Names {
|
||||
pub fn locals(&self) -> &Locals {
|
||||
&self.locals
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user