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

Second test batch and associated fixes

This commit is contained in:
Étienne Fildadut 2023-12-29 17:15:43 +01:00
parent 7abb116876
commit 9b7d1e436e
56 changed files with 760 additions and 27 deletions

View file

@ -17,7 +17,9 @@ AttachBlock = ast.abstract.Node {
end,
_format = function(self, state, priority, indentation, ...)
return self.expression:format(state, priority, indentation, ...).."\n\t"..self.block:format(state, priority, indentation + 1, ...)
local exp = self.expression:format(state, priority, indentation, ...)
if exp:sub(-2) == " _" then exp = exp:sub(1, -3) end
return exp.."\n\t"..self.block:format(state, priority, indentation + 1, ...)
end,
traverse = function(self, fn, ...)