Fix range parsing#86
Conversation
I think it's treated as just a prefix. What is the usual meaning of this syntax? |
It is for journal articles where the first number stands for the article number, the second for the page number; each article starts with its own page 1. However, this was not properly handled. There was no check that the prefix remains the same and the article number was removed. Then I think, this PR handles this correctly now. More complex parsing should be left up to users. |
| if !s.done() { | ||
| return Err(TypeError::new(span, TypeErrorKind::InvalidNumber)); | ||
| } |
There was a problem hiding this comment.
I wonder when these types of failures can happen 🤔
|
Thank you |
Fixes typst/hayagriva#340.
One test fails. Someone needs to explain to me why
21:4-21:6should be parsed as the range4..6. That loses information and makes no sense to me.