Fix integer reading
This commit is contained in:
parent
b51ace40df
commit
c14385a7f8
4 changed files with 4 additions and 4 deletions
|
@ -78,7 +78,6 @@ impl LispState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn execute(&self, instructions: Vec<OpCode>) {
|
pub fn execute(&self, instructions: Vec<OpCode>) {
|
||||||
println!("{:?}", instructions);
|
|
||||||
for op in instructions {
|
for op in instructions {
|
||||||
match op {
|
match op {
|
||||||
OpCode::Call(func, args) => {
|
OpCode::Call(func, args) => {
|
||||||
|
|
|
@ -17,6 +17,7 @@ fn main() {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
println!("{:?}", tokens);
|
||||||
let instructions = parse(tokens);
|
let instructions = parse(tokens);
|
||||||
|
|
||||||
let state = LispState::new();
|
let state = LispState::new();
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
; This is a comment
|
; This is a comment
|
||||||
|
|
||||||
(print "Hello, World")
|
(print (add 1333 12423))
|
||||||
|
|
||||||
(print (add 1 2))
|
|
|
@ -106,6 +106,8 @@ impl Tokenizer {
|
||||||
tokens.push(Token::Integer(self.storage.iter().collect::<String>().parse().unwrap()));
|
tokens.push(Token::Integer(self.storage.iter().collect::<String>().parse().unwrap()));
|
||||||
self.storage.clear();
|
self.storage.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.storage.push(char);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.reading_string {
|
if self.reading_string {
|
||||||
|
|
Reference in a new issue