From c14385a7f895a7b4c6b4d441cc07291cd9517bfc03b61745d48c92948fb6fd0d Mon Sep 17 00:00:00 2001 From: Apache Date: Wed, 12 Jun 2024 19:26:02 -0500 Subject: [PATCH] Fix integer reading --- src/executor.rs | 1 - src/main.rs | 1 + src/test.lisp | 4 +--- src/tokenizer.rs | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/executor.rs b/src/executor.rs index dfa1a2d..4c1febf 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -78,7 +78,6 @@ impl LispState { } pub fn execute(&self, instructions: Vec) { - println!("{:?}", instructions); for op in instructions { match op { OpCode::Call(func, args) => { diff --git a/src/main.rs b/src/main.rs index 3e1bf0c..802ed59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ fn main() { Vec::new() } }; + println!("{:?}", tokens); let instructions = parse(tokens); let state = LispState::new(); diff --git a/src/test.lisp b/src/test.lisp index f4e800a..d7318cb 100644 --- a/src/test.lisp +++ b/src/test.lisp @@ -1,5 +1,3 @@ ; This is a comment -(print "Hello, World") - -(print (add 1 2)) \ No newline at end of file +(print (add 1333 12423)) \ No newline at end of file diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 10d86b5..50c6340 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -106,6 +106,8 @@ impl Tokenizer { tokens.push(Token::Integer(self.storage.iter().collect::().parse().unwrap())); self.storage.clear(); } + + self.storage.push(char); } if self.reading_string {