Skip to content

Commit

Permalink
Merge pull request #31 from stepelu/various-fixes-2
Browse files Browse the repository at this point in the history
FIX: Missing local declaration and check.
  • Loading branch information
franko committed Nov 17, 2015
2 parents 5526f85 + 453d9ee commit 776f221
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lang/luacode-generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ end
ExpressionRule.LogicalExpression = ExpressionRule.BinaryExpression

function ExpressionRule:ConcatenateExpression(node)
local ls = {}
local ls = { }
local cat_prio = operator.left_priority("..")
for k = 1, #node.terms do
local kprio
ls[k], kprio = self:expr_emit(node.terms[k])
if kprio < cat_prio then ls[k] = format("(%s)", ls[k]) end
end
Expand Down Expand Up @@ -403,6 +404,7 @@ local function generate(tree, name)

function self:expr_emit(node)
local rule = ExpressionRule[node.kind]
if not rule then error("cannot find an expression rule for " .. node.kind) end
return rule(self, node)
end

Expand Down

0 comments on commit 776f221

Please sign in to comment.