-
Notifications
You must be signed in to change notification settings - Fork 18
Fix parsing integers with defined length #195
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
base: main
Are you sure you want to change the base?
Conversation
This is only a partial fix, because it doesn't work with integers that start with 0x or 0o.
|
That's an odd one. It seems not to work with the previous parser either and, from the help page, IRAF uses |
|
Could we therefore get rid of the |
|
Yes, this was also my thought: the iraf scanf code does not handle |
While this was implemented in the original PyRAF scanf module, its Python implementation didn't work well. Also it was not implemented in the original IRAF scanf function. Parsing of octal/hexadecimal strings is still possible by using the %o ond %h formats, just like in IRAFs scanf.
|
Yeah, this seems right to me (subject to more testing). It's also getting simpler! Thanks. |
|
I'll take the opportunity and remove also a number of other format options that are not part of IRAF scanf:
|
|
Sounds good (without double checking that list). |
This is only a partial fix, because it doesn't work with integers that start with 0x or 0o. So, the following will not work correctly:
because the first conversion will eat up all (not only the first two digits). This seems however a quite strange case because it is f.e. unclear whether the 0x is valid also for the second part.
I am not even sure whether we shall support
0xor0oprefixes at all; they seem to be artefacts of the old parser. IRAF scanf does not support them.Closes #194