~benaiah

Recent activity

[PATCH] Don't emit headers twice 2 months ago

From Benaiah Mischenko to ~technomancy/fennel

---
Fixes a small issue with the last patch I sent in. Also corrects the comment.

 promote-h1-to-title.lua | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/promote-h1-to-title.lua b/promote-h1-to-title.lua
index 1647c76..d5eef63 100644
--- a/promote-h1-to-title.lua
+++ b/promote-h1-to-title.lua
@@ -1,16 +1,14 @@
local title

--- Promote all headers by one level. Set title from level 1 headers,
[message trimmed]

[PATCH] fennel-lang.org - table of contents 2 months ago

From Benaiah Mischenko to ~technomancy/fennel

Attached is a patch to fennel-lang.org which promotes initial h1
headings to Pandoc titles and adds a table of contents to the reference.
The titles are still emitted as h1 headings, but they now also set the
page title and show up before tables of contents.

For some reason, the Lua filter prints warnings for each of the headings
that it promotes. Nevertheless, the filter still works fine. I'm not
entirely sure what's going on here.

I can rewrite the filter in Fennel and compile it to Lua in the makefile
if that would be preferable to people.

- benaiah

[PATCH] Three patches to pengbot 9 months ago

From Benaiah Mischenko to ~technomancy/fennel

Attached are three patches to pengbot, as follows:

- The change discussed on #fennel to show all returned values when
  evaluating fennel

- A small patch that allows pengbot.fnl to run on Lua 5.3

- The multi-compile command from benbot for which I've been meaning to
  send a patch for some time
  
Let me know if these don't apply cleanly and I'll fix them up.

All the best,
Benaiah Mischenko

[PATCH] Only replace _trailing_ "elseif true" with "else" 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

---
 fennel.lua | 4 +++-
 test.lua   | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fennel.lua b/fennel.lua
index c5e451b..1f3bbe7 100644
--- a/fennel.lua
+++ b/fennel.lua
@@ -1493,7 +1493,9 @@ SPECIALS['if'] = function(ast, scope, parent, opts)
        local branch = branches[i]
        local fstr = not branch.nested and 'if %s then' or 'elseif %s then'
        local cond = tostring(branch.cond)
        local condLine = (cond == "true" and branch.nested) and "else" or fstr:format(cond)
[message trimmed]

[PATCH v2] Make hashfn arguments work when beginning multisyms 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

Converts $ arguments to $1 when they begin a multisym (matches the
behavior of a lone $).

Sets used-local metadata correctly for symbols which begin
multisyms. This was previously incorrect for all symbols which started
multisyms, but the hashfn argument bug fixed in this commit is the
only known effect.

Added test cases for multisyms and immediately-returned arguments to
ensure neither regress.

Enables a getter function shorthand: #$symbol.property

---
[message trimmed]

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

From Benaiah Mischenko to ~technomancy/fennel

---
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]
[message trimmed]

Re: [PATCH] Emit "else" instead of "elseif true then" 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

Phil Hagelberg <phil@hagelb.org> writes:

> This one's actually causing some test failures; can you take another look?

Whoops, should have remembered to run the tests before I submitted the
patch. It was replacing every "if true then" to "else" as well, which
obviously doesn't work in lua. Thanks for catching this - submitting a
fixed and rebased patch now.

- benaiah

[PATCH] Include all tests in the "passed tests" count 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

---
 test.lua | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test.lua b/test.lua
index 2c627c3..6c75cba 100644
--- a/test.lua
+++ b/test.lua
@@ -520,6 +520,8 @@ for code, expected_msg in pairs(compile_failures) do
        fail = fail + 1
        print(" Expected " .. expected_msg .. " when compiling " .. code ..
                  " but got " .. msg)
    else
        pass = pass + 1
[message trimmed]

[PATCH] Emit "else" instead of "elseif true then" 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

---

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

diff --git a/fennel.lua b/fennel.lua
index f68a38e..b1744a8 100644
--- a/fennel.lua
+++ b/fennel.lua
@@ -1448,7 +1448,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))
[message trimmed]

[PATCH] Make hashfn arguments work when beginning multisyms 10 months ago

From Benaiah Mischenko to ~technomancy/fennel

Converts $ arguments to $1 when they begin a multisym (matches the
behavior of a lone $).

Sets used-local metadata correctly for symbols which begin
multisyms. This was previously incorrect for all symbols which started
multisyms, but the hashfn argument bug fixed in this commit is the
only known effect.

Added test cases for multisyms and immediately-returned arguments to
ensure neither regress.

Enables a getter function shorthand: #$symbol.property
---
This version of the patch adds a changelog entry and expands the
[message trimmed]