Fix segmentation fault
This segfault occurs in the future commits, but because it's more important, I'm commiting it first.
This commit is contained in:
parent
fa2dcddd47
commit
9539389e4f
|
@ -315,7 +315,7 @@ enum Token {
|
||||||
impl std::fmt::Display for Token {
|
impl std::fmt::Display for Token {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
return match self {
|
return match self {
|
||||||
token @ Token::IntegerLiteral(_) => write!(f, "{}", token),
|
Token::IntegerLiteral(s) => write!(f, "{}", s),
|
||||||
token => write!(f, "{}", match token {
|
token => write!(f, "{}", match token {
|
||||||
Token::Plus => "+",
|
Token::Plus => "+",
|
||||||
Token::Semicolon => ";",
|
Token::Semicolon => ";",
|
||||||
|
|
Loading…
Reference in a new issue