File tree Expand file tree Collapse file tree 6 files changed +147
-103
lines changed Expand file tree Collapse file tree 6 files changed +147
-103
lines changed Original file line number Diff line number Diff line change 11--[[
22 Name: Evaluator.lua
33 Author: ByteXenon [Luna Gilbert]
4- Date: 2024-02 -21
4+ Date: 2024-05 -21
55--]]
66
77-- * Imports *--
Original file line number Diff line number Diff line change 11--[[
22 Name: Helpers.lua
33 Author: ByteXenon [Luna Gilbert]
4- Date: 2024-01-10
4+ Date: 2024-05-21
55--]]
66
77-- * Imports *--
8+ local char = string.char
9+ local match = string.match
810local gmatch = string.gmatch
911local insert = table.insert
1012
@@ -35,4 +37,18 @@ function Helpers.stringToTable(string)
3537 return table
3638end
3739
40+ --- Converts a pattern to a character lookup table.
41+ -- @param <String> pattern The pattern to convert.
42+ -- @return <Table> table The table of characters.
43+ function Helpers .createPatternLookupTable (pattern )
44+ local lookupTable = {}
45+ for i = 0 , 255 do
46+ local character = char (i )
47+ if match (character , pattern ) then
48+ lookupTable [character ] = true
49+ end
50+ end
51+ return lookupTable
52+ end
53+
3854return Helpers
You can’t perform that action at this time.
0 commit comments