Reset default chapter and verse at semicolons when parsing references #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This could likely be considered a breaking change in how parsing works. Before, the only way to "reset" the default chapter was to encounter a reference with a colon in it. For example, "Genesis 2; 3:15" would parse correctly, but "Genesis 2; 3" would not, since the latter reference had no colon to mark it clearly as indicating a chapter. However, in common usage, the semicolon is what signals to the human reader that what is meant is not verse 3 of chapter 2, but chapters 2 and 3; this updates Pericope to behave the same way.
This is a departure from previous behavior, as is illustrated by the test that is modified as part of this PR. Because of the use of commas and semicolons, the pair of references no longer parsed in the same way. (I referenced the comment and the expected ranges themselves to preference the way that seemed intended.) Even so, common usage being what it is, I would predict the impact of the change to be pretty minimal -- the handful of edge cases corrected by the change should outweigh the number of edge cases broken by the change. That said, I understand if this change needs further scrutiny and care because it changes behavior in this way.