|
|
@ -76,7 +76,7 @@ impl<'a> Interpreter<'a> {
|
|
|
|
self.term(out);
|
|
|
|
self.term(out);
|
|
|
|
out.push(op);
|
|
|
|
out.push(op);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
panic!("Unexpected symbol '{}'", op);
|
|
|
|
panic!("Unexpected symbol '{op}'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -84,7 +84,7 @@ impl<'a> Interpreter<'a> {
|
|
|
|
fn term(&mut self, out: &mut String) {
|
|
|
|
fn term(&mut self, out: &mut String) {
|
|
|
|
match self.next_char() {
|
|
|
|
match self.next_char() {
|
|
|
|
Some(ch) if ch.is_digit(10) => out.push(ch),
|
|
|
|
Some(ch) if ch.is_digit(10) => out.push(ch),
|
|
|
|
Some(ch) => panic!("Unexpected symbol '{}'", ch),
|
|
|
|
Some(ch) => panic!("Unexpected symbol '{ch}'"),
|
|
|
|
None => panic!("Unexpected end of string"),
|
|
|
|
None => panic!("Unexpected end of string"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|