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

Cannot format files containing numbers in LuaJIT-compatible floating point notation #621

Closed
rdw-software opened this issue Nov 23, 2022 · 2 comments · Fixed by #634
Closed
Labels
bug Something isn't working external This issue relies on an external factor
Milestone

Comments

@rdw-software
Copy link

Example:

local num = 0x1p-1026
num = 0x1.5p-3

These are supported in LuaJIT and in fact used in its own Lua modules, e.g. here. Trying to format them results in a parser error:

image


More information about the extension:

tonumber() etc. use builtin string to number conversion

All string-to-number conversions consistently convert integer and floating-point inputs in decimal and hexadecimal on all platforms. strtod() is not used anymore, which avoids numerous problems with poor C library implementations. The builtin conversion function provides full precision according to the IEEE-754 standard, it works independently of the current locale and it supports hex floating-point numbers (e.g. 0x1.5p-3).

Source: https://luajit.org/extensions.html

@JohnnyMorganz
Copy link
Owner

This will be a bug in the parser crate: https://github.com/kampfkarren/full-moon

@rdw-software
Copy link
Author

That's just as well; I've now raised an issue in that repository too :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external This issue relies on an external factor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants