Parenthesizing inline method targets when needed.
This commit is contained in:
parent
2360ada21f
commit
64ba8aee07
@ -85,7 +85,11 @@ tree_to_inline_nomsu = function(tree)
|
||||
end
|
||||
return nomsu
|
||||
elseif "MethodCall" == _exp_0 then
|
||||
local nomsu = NomsuCode:from(tree.source, tree_to_inline_nomsu(tree[1]), "|")
|
||||
local target_nomsu = tree_to_inline_nomsu(tree[1])
|
||||
if tree[1].type == "Action" or tree[1].type == "MethodCall" or tree[1].type == "Block" then
|
||||
target_nomsu:parenthesize()
|
||||
end
|
||||
local nomsu = NomsuCode:from(tree.source, target_nomsu, "|")
|
||||
for i = 2, #tree do
|
||||
if i > 2 then
|
||||
nomsu:add("; ")
|
||||
|
@ -57,7 +57,10 @@ tree_to_inline_nomsu = (tree)->
|
||||
return nomsu
|
||||
|
||||
when "MethodCall"
|
||||
nomsu = NomsuCode\from(tree.source, tree_to_inline_nomsu(tree[1]), "|")
|
||||
target_nomsu = tree_to_inline_nomsu(tree[1])
|
||||
if tree[1].type == "Action" or tree[1].type == "MethodCall" or tree[1].type == "Block"
|
||||
target_nomsu\parenthesize!
|
||||
nomsu = NomsuCode\from(tree.source, target_nomsu, "|")
|
||||
for i=2,#tree
|
||||
nomsu\add "; " if i > 2
|
||||
nomsu\add tree_to_inline_nomsu(tree[i])
|
||||
|
Loading…
Reference in New Issue
Block a user