Skip to content

Accept \p{nv=-0} #19577

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

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Accept \p{nv=-0} #19577

merged 1 commit into from
Apr 8, 2022

Conversation

khwilliamson
Copy link
Contributor

Some platforms already ignore the minus sign. The Unicode standard says
the minus sign should be ignored always.

(But always doing so would cause it to not properly get the only
negative numeric value character in Unicode; I have submitted a ticket
to Unicode about this. Nevertheless, it is in keeping with the letter
and spirit of the standard for the leading minus to be ignored for -0)

Note that -0 not being treated as legal was being tested for. This was the result of a fuzzing operation trying this out and getting assertion failures (#16867), and not because the old behavior was desired. When this P.R is merged, I'll open a ticket to create a new test for that failure. It's not immediately obvious to me, since it was generated by fuzzing.

@khwilliamson
Copy link
Contributor Author

github changed the issue to 16867 when I typed in the CORRECT ISSUE NUMBER which is #17279 which I got this time by giving it a full link which it then abbreviated

@ilmari
Copy link
Member

ilmari commented Apr 1, 2022

the only negative numeric value character in Unicode;

In case anyone else was curious about this, the character is:

U+0F33 TIBETAN DIGIT HALF ZERO

Category: No (Number, Other); East Asian width: N (neutral)
Unicode block: 0F00..0FFF; Tibetan
Numeric value: -1/2
Bidi: L (Left-to-Right)

@khwilliamson
Copy link
Contributor Author

khwilliamson commented Apr 1, 2022 via email

Some platforms already ignore the minus sign.  The Unicode standard says
the minus sign should be ignored always.

(But always doing so would cause it to not properly get the only
negative numeric value character in Unicode; I have submitted a ticket
to Unicode about this.  Nevertheless, it is in keeping with the letter
and spirit of the standard for the leading minus to be ignored for -0)
@khwilliamson khwilliamson merged commit bb5e773 into Perl:blead Apr 8, 2022
@khwilliamson khwilliamson deleted the minus0 branch April 8, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants