-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix Q.of_string #72
Fix Q.of_string #72
Conversation
hhugo
commented
Sep 15, 2020
- exponent are parsed in decimal base
- the base prefix is case insensitive (allowing 0x and 0X)
- fix parsing of hexadecimal with radix
- reduce the number of string allocation
- exponent are parsed in decimal base - the base prefix is case insensitive (allow 0x and 0X) - fix parsing of hexadecimal with radix - reduce the number of string allocation
Fix #65 |
Still need to add regression tests for all fixes |
Well played |
This is ready for review. |
Sure. I'll do it probably tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct AFAIU. However, the use of the Int
module (l.462 : Int.abs
) would break retrocompatibity with OCaml versions before 4.08 which is probably too much. However it can easilly be removed as you explicitely check for the sign of abs
anyway just after. As a minor detail, i'm unsure why the parse_sign
take an exra argument i
since is is always called (once) with i=0
. This could be simplified.
This makes me think that the whole test |
Also, just to be picky the |
Concerning compatibility with old versions of OCaml: version 4.05 is a reasonable base line, as it's the OCaml version found in Debian stable, one of the most conservative free software distributions out there. So, |
I've restored compatibility with ocaml 3.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is now ready for merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of style comments below. I'm willing to merge on behalf of @ghilesZ's review and because the current implementation of of_string
is not right.
I'm also OK to merge. |
I've just created #75 to support underscores |
Looks good to me. Let's merge! |