Skip to content

Commit e0182b3

Browse files
authored
[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>
1 parent 8592b3a commit e0182b3

File tree

6 files changed

+1418
-954
lines changed

6 files changed

+1418
-954
lines changed

client/space_lua/lua.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ Deno.test("[Lua] String to number tests", async () => {
4545
await runLuaTest("./tonumber_test.lua");
4646
});
4747

48+
Deno.test("[Lua] Pattern tests", async () => {
49+
await runLuaTest("./stdlib/pattern_test.lua");
50+
});
51+
4852
Deno.test("[Lua] String tests", async () => {
4953
await runLuaTest("./stdlib/string_test.lua");
50-
// await runLuaTest("./stdlib/string_test2.lua");
5154
});
5255

5356
Deno.test("[Lua] Space Lua tests", async () => {

0 commit comments

Comments
 (0)