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