FPtje / GLuaFixer

Linter for Garry's mod Lua.
https://fptje.github.io/glualint-web/
GNU Lesser General Public License v2.1
142 stars 19 forks source link

Failure to parse number #153

Closed Yogpod closed 1 year ago

Yogpod commented 1 year ago

The code print(0x1.4911360AE2a88p-2) Fails with glualint WindowsTerminal_VKy2lTafBb

But prints in gmod gmod_acgvzwWu5L

Numbers like 0x0.0fp-2 also fail so I think it's an issue with the letters on the right side of the decimal in hex numbers

FPtje commented 1 year ago

Thanks for reporting this bug! So apparently a hexadecimal at the decimal point just means <hex number> / 16, so 0x0.1 is 0.0625, 0x0.2 is 0.125 and so forth. The p is something else that also works for normal numbers.

I'll fix it. In the meantime, may I ask what the use case of those numbers is? I can imagine it's incredibly hard to read floating decimals. What do you use them for?

FPtje commented 1 year ago

Fixed in b3d6a0b2f5ec1627935a19fc7ee21473ec3ca1a5

Yogpod commented 1 year ago

It was causing an error to show in obfuscated lua files, so I guess that's a use case

FPtje commented 1 year ago

That's not the first time obfuscated Lua files cause bug reports to glualint. I guess obfuscation is useful after all.

FPtje commented 1 year ago

Fixed in https://github.com/FPtje/GLuaFixer/releases/tag/1.24.6!