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

Unicode compatibility: replace index arithmetics by prevind #3

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

hhaensel
Copy link
Contributor

There are two cases where unicode characters in f"..." expressions currently fail due to index arithmetics:

  • directly preceeding expressions
  • at the end of the expression

Replacing j-1 by prevind(s, j) solves the problem.

I have included two test cases in the runtest.jl which currently fail:

@test f"π\(2*2)" == "π4"
@test f"π = \(2*90)°" == "π = 180°"

@ScottPJones ScottPJones merged commit b47596d into JuliaString:master Jan 23, 2020
@ScottPJones
Copy link
Member

Thanks! I'm too used to my Str strings, that usually don't need nextind or prevind

@hhaensel
Copy link
Contributor Author

Welcome! Just came across one situation where it failed...
... and through your comment I learned how to use Strs.jl :-)

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.

2 participants