Skip to content

Commit

Permalink
Don't print negative ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Fischman committed Oct 28, 2024
1 parent d98d6b1 commit a99bb3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ast/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Debug for Span {
impl Display for Span {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let start = self.0.get_location(self.1);
let end = self.0.get_location(self.2 - 1);
let end = self.0.get_location((self.2 - 1).max(self.1));
let quote = self.string();
match (&self.0.name, start.line == end.line) {
(Some(filename), true) => write!(
Expand Down

0 comments on commit a99bb3d

Please sign in to comment.