Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct substring end index using thisind #86

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

serenity4
Copy link
Contributor

Fixes #85.

Feel free to refactor this as you see fit, but the basic idea using thisind seems to do the trick!

@tecosaur
Copy link
Collaborator

tecosaur commented Sep 8, 2024

Thanks for the PR! I think I'd rather just make a few tweaks to avoid producing invalid indices than apply thisind after the fact, but thanks for identifying the error and the PR 🙂

Instead of just assuming that pos-1 is a valid string index, along with
all other regions, use lastind/thisind to ensure they are.

Co-authored-by: TEC <git@tecosaur.net>
@tecosaur tecosaur merged commit 448314b into JuliaLang:main Sep 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Iteration error on AnnotatedStrings involving multiple codepoints
2 participants