mirror of
https://github.com/artegoser/ONLang
synced 2024-12-23 01:23:46 +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");
|
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 {
|
"obj" => match value {
|
||||||
Value::Object(value) => {
|
Value::Object(value) => {
|
||||||
return self.calc_obj(value);
|
return self.calc_obj(value);
|
||||||
|
|
Loading…
Add table
Reference in a new issue