Skip to content

Commit

Permalink
fix: zesterer#631 revert change in label.rs to fix error labels
Browse files Browse the repository at this point in the history
When a source does not contain a newline,  labels are lost/ignored and replaced with the fallback `expected something else`.

This reverts the change made in this commit which appears to fix this zesterer@6837537#diff-3d2dfe7e70ee2398dd0941e8f6ea855652695c3f82b7816f649668fb2d56b93dR60
  • Loading branch information
ojkelly authored Jun 22, 2024
1 parent bbb0d70 commit ed2ee19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
inp.errors.alt = old_alt;

if let Some(mut new_alt) = new_alt {
let before_next = before.offset.into();
let before_next = before.offset.into() + 1;
if new_alt.pos.into() == before_next {
new_alt.err.label_with(self.label.clone());
} else if self.is_context && new_alt.pos.into() > before_next {
Expand Down

0 comments on commit ed2ee19

Please sign in to comment.