Fix for lua parsing of long strings/table literals.
This commit is contained in:
parent
f91d06d9fa
commit
6021f04490
@ -1120,6 +1120,8 @@ do
|
||||
local key_str = key_lua.expr:match([=[["']([a-zA-Z_][a-zA-Z0-9_]*)['"]]=])
|
||||
if key_str then
|
||||
insert(items, tostring(key_str) .. "=" .. tostring(value_lua.expr))
|
||||
elseif key_lua.expr:sub(1, 1) == "[" then
|
||||
insert(items, "[ " .. tostring(key_lua.expr) .. "]=" .. tostring(value_lua.expr))
|
||||
else
|
||||
insert(items, "[" .. tostring(key_lua.expr) .. "]=" .. tostring(value_lua.expr))
|
||||
end
|
||||
|
@ -739,6 +739,8 @@ class NomsuCompiler
|
||||
key_str = key_lua.expr\match([=[["']([a-zA-Z_][a-zA-Z0-9_]*)['"]]=])
|
||||
if key_str
|
||||
insert items, "#{key_str}=#{value_lua.expr}"
|
||||
elseif key_lua.expr\sub(1,1) == "["
|
||||
insert items, "[ #{key_lua.expr}]=#{value_lua.expr}"
|
||||
else
|
||||
insert items, "[#{key_lua.expr}]=#{value_lua.expr}"
|
||||
return expr:@@comma_separated_items("{", items, "}")
|
||||
|
Loading…
Reference in New Issue
Block a user