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

Optional leading plus sign not included in textual value of any integral nor all floating-point numbers #784

Open
cowtowncoder opened this issue Jun 28, 2022 · 2 comments

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 28, 2022

Implementation of #774 is mostly complete, but there is one minor inconsistency: whereas leading plus sign -- if (and only if) enabled as non-standard feature -- is retained for some floating-point numbers when accessing token with JsonParser.getText() (and related), it is not retained for any of integral numbers (nor all FPs).

The underlying problem to solve is that of assumptions based on there only ever being a leading minus sign in TextBuffer (or shared input buffer): something that made sense before allowing non-standard leading plus.

@cowtowncoder cowtowncoder changed the title Optional leading plus sign not included in textual value of integral numbers Optional leading plus sign not included in textual value of integral numbers (and possibly some floats) Jun 28, 2022
@cowtowncoder cowtowncoder changed the title Optional leading plus sign not included in textual value of integral numbers (and possibly some floats) Optional leading plus sign not included in textual value of any integral nor all floating-point numbers Jun 28, 2022
@cowtowncoder
Copy link
Member Author

Come to think of this, I may want to remove leading plus sign from all cases, instead of trying to add it.
While ideally it'd be included always, more important to me is the consistency of support.

@cowtowncoder
Copy link
Member Author

Ok, so: for now non-standard plus (+) is never included in text returned. This is different from other deviations, partly since they are omissions (lack of leading 0, or trailing digit after decimal comma).
I guess comparison could be to leading zeroes, handling of which (in non-standard) mode I don't actually know.
But if they are not exposed we could even consider current behavior as the expected way (leave out non-standard characters). Have to think more about this -- then again it will take some effort to retain plus sign anyway so there is no urgency.

@cowtowncoder cowtowncoder added 2.15 and removed 2.14 labels Oct 5, 2022
@cowtowncoder cowtowncoder removed the 2.15 label Jul 13, 2024
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

No branches or pull requests

1 participant