[Space Lua] Implement native Lua pattern matching engine (#1838)
* Add Lua *pattern matching engine* (`pattern.ts`) that directly ports `lstrlib.c` semantics. * Integrate the new engine into the `string` API for `find`, `match`, `gmatch`, and `gsub` functions. * Add a pattern test suite (`pattern_test.lua`) covering character classes, repetition quantifiers, edge cases as well as error conditions. * Refactor `string_test.lua` to remove duplicated pattern tests that are now covered by the pattern test suite. * Fix `string.rep` separator support. * Fix `string.sub` index handling. * Remove the obsolete `string_test2.lua` file. Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
This commit is contained in:
@@ -45,9 +45,12 @@ Deno.test("[Lua] String to number tests", async () => {
|
||||
await runLuaTest("./tonumber_test.lua");
|
||||
});
|
||||
|
||||
Deno.test("[Lua] Pattern tests", async () => {
|
||||
await runLuaTest("./stdlib/pattern_test.lua");
|
||||
});
|
||||
|
||||
Deno.test("[Lua] String tests", async () => {
|
||||
await runLuaTest("./stdlib/string_test.lua");
|
||||
// await runLuaTest("./stdlib/string_test2.lua");
|
||||
});
|
||||
|
||||
Deno.test("[Lua] Space Lua tests", async () => {
|
||||
|
||||
Reference in New Issue
Block a user