mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 04:12:42 +00:00
replaced Box<str> with SmolStr
This commit is contained in:
parent
fb88595b6c
commit
da6a820638
21 changed files with 137 additions and 85 deletions
|
|
@ -3,6 +3,7 @@ use std::rc::Rc;
|
|||
|
||||
use rlox2_frontend::lexer::LexerError;
|
||||
use rlox2_frontend::parser::{BinaryOp, ParserError, UnaryOp};
|
||||
use smol_str::SmolStr;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::Value;
|
||||
|
|
@ -45,7 +46,7 @@ pub enum RuntimeError {
|
|||
#[error("only objects have attributes")]
|
||||
InvalidSetTarget,
|
||||
#[error("class {0} has no property {name}", class.name())]
|
||||
UndefinedAttribute { class: Rc<LoxClass>, name: Box<str> },
|
||||
UndefinedAttribute { class: Rc<LoxClass>, name: SmolStr },
|
||||
#[error("{value} is not a valid superclass")]
|
||||
InvalidSuperclass { value: Value },
|
||||
#[error("stack overflow")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue