aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-05-30 23:50:59 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-05-30 23:50:59 -0700
commit311d3ae9a3b0a014e14e885ddbdf35a6c1cfd3ce (patch)
tree8899bfbe187aeb641cea8bf1d282fabcb63da8c1 /src/main.rs
parentda297e692c4131eac3631b8440561c8dbc78f480 (diff)
downloadqc-311d3ae9a3b0a014e14e885ddbdf35a6c1cfd3ce.tar.zst
Add bytecode.
A recursive AST is kind of annoying to evaluate without recursion. Bytecode is cooler anyway.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 9af3e48..9c1e107 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,6 @@
mod eval;
-mod expr;
mod lexer;
+mod op;
mod parser;
use gdk4::{Key, ModifierType};
@@ -39,8 +39,8 @@ fn main() -> ExitCode {
{
window.destroy();
}
- if let Some(n) = parser::parse(&input.text()) {
- output.set_text(&format!("{}", n.eval()));
+ if let Some(bytecode) = parser::parse(&input.text()) {
+ output.set_text(&format!("{}", op::eval(&bytecode)));
}
}),
);