AST - Removed unused import, reformatted.
This commit is contained in:
parent
1e122c77a5
commit
c0bf521b61
1 changed files with 8 additions and 6 deletions
14
src/ast.rs
14
src/ast.rs
|
@ -1,4 +1,4 @@
|
|||
use crate::tokens::{Token, TokenType};
|
||||
use crate::tokens::Token;
|
||||
|
||||
/// This trait should be implemented by nodes to allow AST dumps.
|
||||
pub trait AstDumper {
|
||||
|
@ -45,11 +45,13 @@ impl AstDumper for ExprNode {
|
|||
Self::Grouping { expression } => {
|
||||
format!("( {} )", expression.dump())
|
||||
}
|
||||
Self::Litteral { value } => if value.is_litteral() {
|
||||
value.lexeme.clone()
|
||||
} else {
|
||||
panic!("Unexpected token type for token {:#?}", value)
|
||||
},
|
||||
Self::Litteral { value } => {
|
||||
if value.is_litteral() {
|
||||
value.lexeme.clone()
|
||||
} else {
|
||||
panic!("Unexpected token type for token {:#?}", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue