fix type parsing bugs

This commit is contained in:
2024-10-23 22:10:48 -04:00
parent 8fbb4780df
commit ae7600ba81
4 changed files with 62 additions and 34 deletions

View File

@@ -317,6 +317,8 @@ where
},
ParseTree::FunctionCall(ident, args) => {
let obj = self.get_object_mut(&ident)?;
let globals = Self::obj_globals(obj);
let locals = Self::obj_locals(obj);
let v = Self::eval(obj)?;
match v {
@@ -325,7 +327,7 @@ where
.map(|x| Object::variable(x, self.globals.clone(), self.locals.clone()))
.collect();
f.call(Self::obj_globals(obj), Self::obj_locals(obj), args)
f.call(globals, locals, args)
},
_ => Err(RuntimeError::FunctionUndefined(ident.clone()))
}