Remove write_token_error_context
(#417)
This commit is contained in:
parent
9c82a1e329
commit
fce4c232d3
@ -4,17 +4,6 @@ use brev::OutputError;
|
|||||||
|
|
||||||
use crate::misc::{maybe_s, ticks, write_error_context, And, Or, Tick};
|
use crate::misc::{maybe_s, ticks, write_error_context, And, Or, Tick};
|
||||||
|
|
||||||
fn write_token_error_context(f: &mut Formatter, token: &Token) -> Result<(), fmt::Error> {
|
|
||||||
write_error_context(
|
|
||||||
f,
|
|
||||||
token.text,
|
|
||||||
token.offset,
|
|
||||||
token.line,
|
|
||||||
token.column,
|
|
||||||
token.lexeme().len(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum RuntimeError<'a> {
|
pub enum RuntimeError<'a> {
|
||||||
ArgumentCountMismatch {
|
ArgumentCountMismatch {
|
||||||
@ -400,7 +389,14 @@ impl<'a> Display for RuntimeError<'a> {
|
|||||||
write!(f, "{}", message.suffix())?;
|
write!(f, "{}", message.suffix())?;
|
||||||
|
|
||||||
if let Some(token) = error_token {
|
if let Some(token) = error_token {
|
||||||
write_token_error_context(f, token)?;
|
write_error_context(
|
||||||
|
f,
|
||||||
|
token.text,
|
||||||
|
token.offset,
|
||||||
|
token.line,
|
||||||
|
token.column,
|
||||||
|
token.lexeme().len(),
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user