mirror of
https://github.com/TheM1Stery/izanami.git
synced 2025-04-20 00:41:11 +00:00
misc: cleanup
This commit is contained in:
parent
933b6e052d
commit
90f7755c0c
@ -3,7 +3,7 @@ use std::{cell::RefCell, fmt::Display, rc::Rc};
|
|||||||
use crate::{
|
use crate::{
|
||||||
ast::Stmt,
|
ast::Stmt,
|
||||||
environment::Environment,
|
environment::Environment,
|
||||||
interpreter::{execute_block, InterpreterEnvironment, InterpreterSignal, RuntimeError},
|
interpreter::{execute_block, InterpreterEnvironment, InterpreterSignal},
|
||||||
token::{LiteralType, Token},
|
token::{LiteralType, Token},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
use crate::{
|
use crate::token::{LiteralType, Token};
|
||||||
callable::Callable,
|
|
||||||
token::{LiteralType, Token},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Environment {
|
pub struct Environment {
|
||||||
|
@ -22,7 +22,7 @@ fn main() -> ExitCode {
|
|||||||
return ExitCode::from(75);
|
return ExitCode::from(75);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(RunError::RuntimeError(r)) = result {
|
if let Err(RunError::RuntimeError(_r)) = result {
|
||||||
return ExitCode::from(70);
|
return ExitCode::from(70);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use crate::{ast::Expr, token::LiteralType};
|
use crate::{ast::Expr, token::LiteralType};
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn pretty_print(expr: &Expr) -> String {
|
pub fn pretty_print(expr: &Expr) -> String {
|
||||||
match expr {
|
match expr {
|
||||||
Expr::Binary { left, op, right } => parenthesize(&op.lexeme, &[left, right]),
|
Expr::Binary { left, op, right } => parenthesize(&op.lexeme, &[left, right]),
|
||||||
|
@ -72,6 +72,7 @@ impl Scanner {
|
|||||||
Ok(&self.tokens)
|
Ok(&self.tokens)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn is_at_end(&self) -> bool {
|
fn is_at_end(&self) -> bool {
|
||||||
self.current >= self.source.len()
|
self.current >= self.source.len()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user