use crate::{
define_error,
diagnostics::Builder,
utils::{Located, Location},
};
pub struct UnterminatedString(pub Location);
define_error!(
UnterminatedString {
fn build(&self, builder: Builder) -> Builder {
builder.label(self.0.primary("this string was never terminated"),)
}
fn location(&self) -> Location {
self.0
}
}
);
pub struct InvalidHex(pub Location);
define_error!(
InvalidHex {
fn build(&self, builder: Builder) -> Builder {
builder.label(self.0.primary("this is not a valid hexidecimal value"))
}
fn location(&self) -> Location {
self.0.location()
}
}
);
pub struct UnexpectedChar(pub Location);
define_error!(
UnexpectedChar {
fn build(&self, builder: Builder) -> Builder {
builder.label(self.0.primary("did not expect this character in this position"))
}
fn location(&self) -> Location {
self.0
}
}
);