mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
ArgumentTuple cleanup
This commit is contained in:
parent
fe351b5ca4
commit
ffadc0dd69
12 changed files with 88 additions and 105 deletions
|
|
@ -18,7 +18,7 @@ return infix {
|
|||
end,
|
||||
|
||||
build_ast = function(self, left, right)
|
||||
left.arguments:set_assignment(right)
|
||||
left.arguments:add_assignment(right)
|
||||
return Call:new(left.func, left.arguments) -- recreate Call since we modified left.arguments
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ return infix {
|
|||
|
||||
build_ast = function(self, left, right)
|
||||
if Call:is(right) then
|
||||
right.arguments:insert_positional(1, left)
|
||||
return right
|
||||
return Call:new(right.func, right.arguments:with_first_argument(left))
|
||||
else
|
||||
return Call:new(right, ArgumentTuple:new(left))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ return secondary {
|
|||
exp = Tuple:new(exp)
|
||||
end
|
||||
|
||||
for i, v in ipairs(exp.list) do
|
||||
for _, v in ipairs(exp.list) do
|
||||
if Assignment:is(v) then
|
||||
args:set_named(v.identifier, v.expression)
|
||||
args:add_named(v.identifier, v.expression)
|
||||
else
|
||||
args:set_positional(i, v)
|
||||
args:add_positional(v)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue