Fixed untested codepath for generating ($x, (foo; baz))

This commit is contained in:
Bruce Hill 2019-01-25 15:01:29 -08:00
parent 364f3c894b
commit 1713a0e38f
2 changed files with 8 additions and 0 deletions

View File

@ -94,12 +94,18 @@ tree_to_inline_nomsu = function(tree)
target_nomsu:parenthesize() target_nomsu:parenthesize()
end end
local nomsu = NomsuCode:from(tree.source, target_nomsu, ", ") local nomsu = NomsuCode:from(tree.source, target_nomsu, ", ")
if #tree > 2 then
nomsu:add("(")
end
for i = 2, #tree do for i = 2, #tree do
if i > 2 then if i > 2 then
nomsu:add("; ") nomsu:add("; ")
end end
nomsu:add(tree_to_inline_nomsu(tree[i])) nomsu:add(tree_to_inline_nomsu(tree[i]))
end end
if #tree > 2 then
nomsu:add(")")
end
return nomsu return nomsu
elseif "EscapedNomsu" == _exp_0 then elseif "EscapedNomsu" == _exp_0 then
local inner_nomsu = tree_to_inline_nomsu(tree[1]) local inner_nomsu = tree_to_inline_nomsu(tree[1])

View File

@ -64,9 +64,11 @@ tree_to_inline_nomsu = (tree)->
if tree[1].type == "Block" if tree[1].type == "Block"
target_nomsu\parenthesize! target_nomsu\parenthesize!
nomsu = NomsuCode\from(tree.source, target_nomsu, ", ") nomsu = NomsuCode\from(tree.source, target_nomsu, ", ")
if #tree > 2 then nomsu\add "("
for i=2,#tree for i=2,#tree
nomsu\add "; " if i > 2 nomsu\add "; " if i > 2
nomsu\add tree_to_inline_nomsu(tree[i]) nomsu\add tree_to_inline_nomsu(tree[i])
if #tree > 2 then nomsu\add ")"
return nomsu return nomsu
when "EscapedNomsu" when "EscapedNomsu"