1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 09:09:31 +00:00

ArgumentTuple cleanup

This commit is contained in:
Étienne Fildadut 2023-12-23 00:22:00 +01:00
parent fe351b5ca4
commit ffadc0dd69
12 changed files with 88 additions and 105 deletions

View file

@ -52,14 +52,14 @@ Call = ast.abstract.Node {
if Identifier:is(self.func) then
local name, arity = self.func.name, self.arguments.arity
if infix[name] and arity == 2 then
local left = self.arguments.list[1]:format(...)
local right = self.arguments.list[2]:format_right(...)
local left = self.arguments.positional[1]:format(...)
local right = self.arguments.positional[2]:format_right(...)
return ("%s %s %s"):format(left, name:match("^_(.*)_$"), right)
elseif prefix[name] and arity == 1 then
local right = self.arguments.list[1]:format_right(...)
local right = self.arguments.positional[1]:format_right(...)
return ("%s%s"):format(name:match("^(.*)_$"), right)
elseif suffix[name] and arity == 1 then
local left = self.arguments.list[1]:format(...)
local left = self.arguments.positional[1]:format(...)
return ("%s%s"):format(left, name:match("^_(.*)$"))
end
end