Fix arithmetic coercion - refactored and enhanced (#1576)

The Lua 5.4 compatible `tonumber` implementation completely reworked

- custom char-by-char parser (no regexes)
- proper Lua space handling
- support for heximal integers and floats
- support for scientific float notation
- extended tests
- updated website docs

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
This commit is contained in:
Matouš Jan Fialka
2025-10-01 11:30:58 +02:00
committed by GitHub
parent 26d9d5bdf0
commit 80f31da16b
7 changed files with 656 additions and 48 deletions
+4
View File
@@ -13,6 +13,10 @@ Deno.test("[Lua] Table tests", async () => {
await runLuaTest("./stdlib/table_test.lua");
});
Deno.test("[Lua] String to number tests", async () => {
await runLuaTest("./tonumber_test.lua");
});
Deno.test("[Lua] String tests", async () => {
await runLuaTest("./stdlib/string_test.lua");
// await runLuaTest("./stdlib/string_test2.lua");