implemented more nodes
This commit is contained in:
parent
b7834b5244
commit
a5cc6813d1
|
@ -24,7 +24,11 @@ impl Node for Call {
|
|||
};
|
||||
|
||||
let arguments = if let NodeEnum::Set(set) = self.arguments.as_ref() {
|
||||
set.get_values()
|
||||
let mut arguments = vec![];
|
||||
for value in set.get_values().iter() {
|
||||
arguments.push(value.evaluate(env)?);
|
||||
}
|
||||
arguments
|
||||
} else {
|
||||
panic!(
|
||||
"This shoulnd not be possible, but call constructed with arguments of type that is not set"
|
||||
|
@ -44,7 +48,7 @@ impl Node for Call {
|
|||
// Call function body with arguments
|
||||
match func.get_body() {
|
||||
// Pass arguments to native function
|
||||
FunctionType::Native(_name, native_function) => native_function(arguments),
|
||||
FunctionType::Native(_name, native_function) => native_function(&arguments),
|
||||
FunctionType::UserFunction(node_enum) => {
|
||||
// TODO: Push scope
|
||||
// Define variables
|
||||
|
|
Loading…
Reference in a new issue