3b47098ebe
Package-Manager: Portage-3.0.10, Repoman-3.0.2 Signed-off-by: Horea Christian <chr@chymera.eu>
43 lines
1.7 KiB
Diff
43 lines
1.7 KiB
Diff
--- b/ExpandTemplateGenerator/ExpandTemplate.lua
|
|
+++ a/ExpandTemplateGenerator/ExpandTemplate.lua
|
|
@@ -193,7 +193,7 @@
|
|
else -- expression
|
|
var = 'return '.. var
|
|
end
|
|
+ local f = assert(loadstring(var))
|
|
- local f = assert(load(var))
|
|
local t = searchlist[1]
|
|
assert(type(t)=='table' or type(t)=='userdata', 'expecting table')
|
|
setfenv(f, setmetatable({}, {__index=get, __newindex=t}))
|
|
--- b/ExpandTemplateGenerator/JSONQuery.lua
|
|
+++ a/ExpandTemplateGenerator/JSONQuery.lua
|
|
@@ -45,7 +45,7 @@
|
|
|
|
for i=2,#arg do
|
|
json_path=arg[i]
|
|
+ cmd = loadstring("return json_table."..json_path)
|
|
- cmd = load("return json_table."..json_path)
|
|
if not cmd then
|
|
io.stderr:write("Warning: bad path -> "..json_path.."\n")
|
|
bad_count = bad_count+1
|
|
--- b/ExpandTemplateGenerator/json.lua
|
|
+++ a/ExpandTemplateGenerator/json.lua
|
|
@@ -231,7 +231,7 @@
|
|
endPos = endPos + 1
|
|
end
|
|
local stringValue = 'return ' .. string.sub(s,startPos, endPos-1)
|
|
+ local stringEval = base.loadstring(stringValue)
|
|
- local stringEval = load(stringValue)
|
|
base.assert(stringEval, 'Failed to scan number [ ' .. stringValue .. '] in JSON string at position ' .. startPos .. ' : ' .. endPos)
|
|
return stringEval(), endPos
|
|
end
|
|
@@ -305,7 +305,7 @@
|
|
base.assert(endPos <= stringLen+1, "String decoding failed: unterminated string at position " .. endPos)
|
|
until bEnded
|
|
local stringValue = 'return ' .. string.sub(s, startPos, endPos-1)
|
|
+ local stringEval = base.loadstring(stringValue)
|
|
- local stringEval = load(stringValue)
|
|
base.assert(stringEval, 'Failed to load string [ ' .. stringValue .. '] in JSON4Lua.decode_scanString at position ' .. startPos .. ' : ' .. endPos)
|
|
return stringEval(), endPos
|
|
end
|