mirror of
https://github.com/artegoser/ONLang
synced 2024-12-23 09:33:44 +03:00
fix: returning strings, numbers, arrays, booleans
This commit is contained in:
parent
8fef9f68e2
commit
bd9aa89e07
1 changed files with 11 additions and 5 deletions
|
@ -451,11 +451,17 @@ impl Interpreter {
|
||||||
Value::Object(name) => {
|
Value::Object(name) => {
|
||||||
let check = name.get("return");
|
let check = name.get("return");
|
||||||
match check {
|
match check {
|
||||||
Some(check) => {
|
Some(check) => match check {
|
||||||
|
Value::Object(_) => {
|
||||||
let result = json!({"return": self.eval_node(check)});
|
let result = json!({"return": self.eval_node(check)});
|
||||||
self.exit_from_scope();
|
self.exit_from_scope();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
_ => {
|
||||||
|
self.exit_from_scope();
|
||||||
|
return json!({"return": check.clone()});
|
||||||
|
}
|
||||||
|
},
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue