Skip to content

Commit cc7cd25

Browse files
authored
Merge pull request #240 from prometheus-lua/fix/four-bugs
Fix four bugs: ForIn body dropped, step max error, setLuaVersion case, Lua52 refs
2 parents 2e8dc69 + 74d0ca1 commit cc7cd25

5 files changed

Lines changed: 5 additions & 176 deletions

File tree

src/prometheus/pipeline.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function Pipeline:setLuaVersion(luaVersion)
133133
luaVersion = luaVersion;
134134
});
135135
self.unparser = Unparser:new({
136-
luaVersion = luaVersion;
136+
LuaVersion = luaVersion;
137137
});
138138
self.conventions = conventions;
139139
end

src/prometheus/step.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function Step:new(settings)
5555

5656
if data.max then
5757
if settingValue > data.max then
58-
logger:error(string.format("Invalid value for the Setting \"%s\" of the Step \"%s\". The biggest allowed value is %d", key, self.Name, data.min));
58+
logger:error(string.format("Invalid value for the Setting \"%s\" of the Step \"%s\". The biggest allowed value is %d", key, self.Name, data.max));
5959
end
6060
end
6161

src/prometheus/steps/SplitStrings.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ end
167167

168168
local function generateCustomFunctionLiteral(parentScope, variant)
169169
local parser = Parser:new({
170-
LuaVersion = LuaVersion.Lua52;
170+
LuaVersion = LuaVersion.Lua51;
171171
});
172172

173173
-- Custom Function Type 1
@@ -190,7 +190,7 @@ end
190190

191191
local function generateGlobalCustomFunctionDeclaration(ast, data)
192192
local parser = Parser:new({
193-
LuaVersion = LuaVersion.Lua52;
193+
LuaVersion = LuaVersion.Lua51;
194194
});
195195

196196
-- Custom Function Type 1

src/prometheus/visitast.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function visitStatement(statement, previsit, postvisit, data)
139139
for i, expression in ipairs(statement.expressions) do
140140
statement.expressions[i] = visitExpression(expression, previsit, postvisit, data);
141141
end
142-
visitBlock(statement.body, previsit, postvisit, data, false);
142+
statement.body = visitBlock(statement.body, previsit, postvisit, data, false);
143143
elseif(statement.kind == AstKind.IfStatement) then
144144
statement.condition = visitExpression(statement.condition, previsit, postvisit, data);
145145
statement.body = visitBlock(statement.body, previsit, postvisit, data, false);

tests.lua

Lines changed: 0 additions & 171 deletions
This file was deleted.

0 commit comments

Comments
 (0)