Fix integer reading

This commit is contained in:
Apache 2024-06-12 19:26:02 -05:00
parent b51ace40df
commit ec48ff8852
Signed by: apache
GPG key ID: 6B10F3EAF14F4C77
4 changed files with 6 additions and 4 deletions

View file

@ -78,7 +78,6 @@ impl LispState {
}
pub fn execute(&self, instructions: Vec<OpCode>) {
println!("{:?}", instructions);
for op in instructions {
match op {
OpCode::Call(func, args) => {

View file

@ -17,6 +17,7 @@ fn main() {
Vec::new()
}
};
println!("{:?}", tokens);
let instructions = parse(tokens);
let state = LispState::new();

View file

@ -1,5 +1,3 @@
; This is a comment
(print "Hello, World")
(print (add 1 2))
(print (add 1333 12423))

View file

@ -92,6 +92,7 @@ impl Tokenizer {
tokens.push(Token::Identifier(self.storage.iter().collect()));
self.storage.clear();
continue;
}
self.storage.push(char);
@ -105,6 +106,9 @@ impl Tokenizer {
tokens.push(Token::Integer(self.storage.iter().collect::<String>().parse().unwrap()));
self.storage.clear();
} else {
self.storage.push(char);
continue;
}
}