mirror of
https://github.com/artegoser/ONLang
synced 2024-11-05 20:43:57 +03:00
feat: toString method
This commit is contained in:
parent
66ba25c8b6
commit
d5d2e81ebb
1 changed files with 7 additions and 0 deletions
|
@ -191,6 +191,13 @@ impl Interpreter {
|
|||
self.error("Unsupported data type for the `arr` argument, must be an array");
|
||||
}
|
||||
},
|
||||
"toString" => {
|
||||
return serde_json::Value::String(
|
||||
serde_json::to_string_pretty(&self.eval_node(value))
|
||||
.expect("Some error"),
|
||||
)
|
||||
}
|
||||
|
||||
"obj" => match value {
|
||||
Value::Object(value) => {
|
||||
return self.calc_obj(value);
|
||||
|
|
Loading…
Reference in a new issue