CLIPPY IS GOD.

This commit is contained in:
Emmanuel BENOîT 2023-01-02 14:10:32 +01:00
parent 2f0798bfe1
commit a317e54426
3 changed files with 28 additions and 45 deletions

View file

@ -18,7 +18,7 @@ pub enum StmtNode {
/// The print statement
Print(ExprNode),
/// A block containing multiple statements.
Block(Vec<Box<StmtNode>>),
Block(Vec<StmtNode>),
/// A conditional statement.
IfStmt {
condition: ExprNode,
@ -100,7 +100,7 @@ impl AstDumper for StmtNode {
match self {
Self::VarDecl(name, Some(expr)) => format!("( var {} {} )", name.lexeme, expr.dump()),
Self::VarDecl(name, None) => format!("( var {} nil )", name.lexeme),
Self::Expression(expr) => format!("{}", expr.dump()),
Self::Expression(expr) => expr.dump(),
Self::Print(expr) => format!("(print {})", expr.dump()),
Self::Block(stmts) => format!(