aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-03-24 12:46:52 +0000
committerAkshay <[email protected]>2021-03-24 12:47:30 +0000
commit240aca36313016df68f03954c54c2bc21910344e (patch)
treea8153e24c23f3142ee120f6b921b722b07ace095 /src/app.rs
parent1a152b5cdaf3e636a5f495e81895d35d0f841c44 (diff)
rename env to eval, add div operator
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/app.rs b/src/app.rs
index 7417dae..008b273 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -3,7 +3,7 @@ use crate::{
3 command::CommandBox, 3 command::CommandBox,
4 consts::{colors::*, FONT_PATH}, 4 consts::{colors::*, FONT_PATH},
5 dither, 5 dither,
6 lisp::{env, lex::Lexer, parse::Parser, Environment}, 6 lisp::{eval, lex::Lexer, parse::Parser, Environment},
7 message::Message, 7 message::Message,
8 rect, 8 rect,
9 symmetry::Symmetry, 9 symmetry::Symmetry,
@@ -13,7 +13,6 @@ use crate::{
13 13
14use std::{convert::From, fs::File, io::prelude::*}; 14use std::{convert::From, fs::File, io::prelude::*};
15 15
16use log::{info, warn};
17use obi::Image; 16use obi::Image;
18use sdl2::{ 17use sdl2::{
19 event::Event, 18 event::Event,
@@ -281,7 +280,7 @@ impl<'ctx> AppState<'ctx> {
281 let lisp_expr = &self.command_box.text; 280 let lisp_expr = &self.command_box.text;
282 let mut parser = Parser::new(Lexer::new(lisp_expr, 0)); 281 let mut parser = Parser::new(Lexer::new(lisp_expr, 0));
283 let res = parser.parse_single_expr(); 282 let res = parser.parse_single_expr();
284 match env::eval(&res.unwrap(), self, None) { 283 match eval::eval(&res.unwrap(), self, None) {
285 Ok(val) => { 284 Ok(val) => {
286 self.message.text = format!("{}", val); 285 self.message.text = format!("{}", val);
287 } 286 }
@@ -519,7 +518,7 @@ impl<'ctx> AppState<'ctx> {
519 symmetry: Default::default(), 518 symmetry: Default::default(),
520 ttf_context, 519 ttf_context,
521 undo_stack: UndoStack::new(), 520 undo_stack: UndoStack::new(),
522 lisp_env: env::with_prelude(), 521 lisp_env: eval::with_prelude(),
523 zoom: 5, 522 zoom: 5,
524 } 523 }
525 } 524 }