forked from AbleScript/ablescript
Changed position terminology
This commit is contained in:
parent
2084ebeed1
commit
f893e24aed
|
@ -1,5 +1,6 @@
|
|||
#![forbid(unsafe_code)]
|
||||
|
||||
mod ast;
|
||||
mod base_55;
|
||||
mod brian;
|
||||
mod error;
|
||||
|
@ -48,8 +49,8 @@ fn main() {
|
|||
println!(
|
||||
"Error `{:?}` occurred at span: {:?} = `{:?}`",
|
||||
e.kind,
|
||||
e.position.clone(),
|
||||
source.slice(e.position)
|
||||
e.span.clone(),
|
||||
source.slice(e.span)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ pub fn repl() {
|
|||
println!(
|
||||
"Error `{:?}` occurred at span: {:?} = `{:?}`",
|
||||
e.kind,
|
||||
e.position.clone(),
|
||||
line.slice(e.position.clone())
|
||||
e.span.clone(),
|
||||
line.slice(e.span.clone())
|
||||
);
|
||||
|
||||
println!(" | {}", line);
|
||||
println!(
|
||||
" {}{}-- Here",
|
||||
" ".repeat(e.position.start),
|
||||
"^".repeat((e.position.end - e.position.start).max(1))
|
||||
" ".repeat(e.span.start),
|
||||
"^".repeat((e.span.end - e.span.start).max(1))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue