mirror of
https://github.com/artegoser/ONLang
synced 2025-02-23 12:43:13 +03:00
feat: clear console
This commit is contained in:
parent
54cef02d79
commit
89207ca812
6 changed files with 9 additions and 99 deletions
|
@ -131,6 +131,9 @@ impl Interpreter {
|
|||
"ErrExit" => {
|
||||
self.err_exit();
|
||||
}
|
||||
"clear" => {
|
||||
self.clear();
|
||||
}
|
||||
"break" => return Value::String("break".to_string()),
|
||||
"continue" => return Value::String("continue".to_string()),
|
||||
value => {
|
||||
|
@ -147,6 +150,10 @@ impl Interpreter {
|
|||
return Value::Null;
|
||||
}
|
||||
|
||||
fn clear(&self) {
|
||||
print!("{}[2J", 27 as char);
|
||||
}
|
||||
|
||||
fn if_node(&mut self, value: &Map<String, Value>) -> Value {
|
||||
let condition = self.eval_node(&value["condition"]);
|
||||
let nodes = &value.get("body");
|
||||
|
|
Loading…
Add table
Reference in a new issue