This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH v2] Emit "else" instead of "elseif true then"

Message ID
DKIM signature
Download raw message
Patch: +2 -1
Fixes the last patch version's bad code caused by replacing "if true"
with "else"

 fennel.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fennel.lua b/fennel.lua
index b07b47e..e5d18e6 100644
--- a/fennel.lua
+++ b/fennel.lua
@@ -1483,7 +1483,8 @@ SPECIALS['if'] = function(ast, scope, parent, opts)
    for i = 1, #branches do
        local branch = branches[i]
        local fstr = not branch.nested and 'if %s then' or 'elseif %s then'
        local condLine = fstr:format(tostring(branch.cond))
        local cond = tostring(branch.cond)
        local condLine = (cond == "true" and branch.nested) and "else" or fstr:format(cond)
        if branch.nested then
            emit(lastBuffer, branch.condchunk, ast)
Review patch Export thread (mbox)