zesterer / chumsky

Write expressive, high-performance parsers with ease.
https://crates.io/crates/chumsky
MIT License
3.64k stars 155 forks source link

fix: #631 revert change in label.rs to fix error labels #645

Open ojkelly opened 5 months ago

ojkelly commented 5 months ago

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 https://github.com/zesterer/chumsky/commit/68375371a5fde6ee14f190c14e9a9cee0697f022#diff-3d2dfe7e70ee2398dd0941e8f6ea855652695c3f82b7816f649668fb2d56b93dR60

zesterer commented 5 months ago

Hmm. I am a bit suspicious of this, but I need to take another look at it at some point. Do tests continue to pass with --features label?

ojkelly commented 5 months ago

Hmm. I am a bit suspicious of this, but I need to take another look at it at some point.

Yeah me too, I'm not familiar with this part of the codebase. I had a play around with the diffs to see what would fix it for my repo and this has.

Looks like the tests are failing.

xldenis commented 4 months ago

I seem to be encountering this issue in alpha.7 when using select! in combination with a logos lexer. I'll need to investigate further to minimize.

xldenis commented 4 months ago

I replicated this issue locally with a parser and confirmed this patch fixes it. Additionally, the CI failures seem to be spurious failures caused by time. I think if @zesterer restarts CI it should pass.

zesterer commented 1 month ago

I replicated this issue locally with a parser and confirmed this patch fixes it. Additionally, the CI failures seem to be spurious failures caused by time. I think if @zesterer restarts CI it should pass.

As a point of interest, do you have an example of what you think the correct behaviour is that you can turn into a test? That would be very useful for figuring out the best way to implement a fix.