Skip to content

Commit 45577b6

Browse files
authored
fix: check for escaped keys and handle them correctly (#23)
Original author is @vE5li. The commit was resigned in order to be merged upstream.
1 parent 875636e commit 45577b6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lua/libmodal/collections/ParseTable.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ local function get(parse_table, lhs_reversed_bytes)
3939
return parse_table
4040
end
4141

42+
local out = k
43+
44+
if type(k) == "string" then
45+
for index = 1, #k do
46+
local character = k:byte(index)
47+
48+
if index == 1 then
49+
out = character
50+
else
51+
table.insert(lhs_reversed_bytes, 1, character)
52+
end
53+
end
54+
end
55+
56+
k = out
57+
4258
--[[ Parse the `k`. ]]
4359

4460
-- make sure the dicitonary has a key for that value.

0 commit comments

Comments
 (0)