misc: cleanup

This commit is contained in:
Seymur Bagirov 2025-02-25 13:18:59 +04:00
parent 933b6e052d
commit 90f7755c0c
5 changed files with 5 additions and 6 deletions

View File

@ -3,7 +3,7 @@ use std::{cell::RefCell, fmt::Display, rc::Rc};
use crate::{
ast::Stmt,
environment::Environment,
interpreter::{execute_block, InterpreterEnvironment, InterpreterSignal, RuntimeError},
interpreter::{execute_block, InterpreterEnvironment, InterpreterSignal},
token::{LiteralType, Token},
};

View File

@ -1,9 +1,6 @@
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use crate::{
callable::Callable,
token::{LiteralType, Token},
};
use crate::token::{LiteralType, Token};
#[derive(Debug, Clone)]
pub struct Environment {

View File

@ -22,7 +22,7 @@ fn main() -> ExitCode {
return ExitCode::from(75);
}
if let Err(RunError::RuntimeError(r)) = result {
if let Err(RunError::RuntimeError(_r)) = result {
return ExitCode::from(70);
}

View File

@ -1,5 +1,6 @@
use crate::{ast::Expr, token::LiteralType};
#[allow(dead_code)]
pub fn pretty_print(expr: &Expr) -> String {
match expr {
Expr::Binary { left, op, right } => parenthesize(&op.lexeme, &[left, right]),

View File

@ -72,6 +72,7 @@ impl Scanner {
Ok(&self.tokens)
}
#[allow(dead_code)]
fn is_at_end(&self) -> bool {
self.current >= self.source.len()
}