~technomancy/fennel

use fennelview in comment special to keep tables in comments v1 APPLIED

Andrey Listopadov: 1
 use fennelview in comment special to keep tables in comments

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/24049/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] use fennelview in comment special to keep tables in comments Export this patch

---
 src/fennel/specials.fnl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fennel/specials.fnl b/src/fennel/specials.fnl
index 8d74bd9..171b302 100644
--- a/src/fennel/specials.fnl
+++ b/src/fennel/specials.fnl
@@ -720,7 +720,7 @@ Method name doesn't have to be known at compile-time; if it is, use
(fn SPECIALS.comment [ast _ parent]
  (let [els []]
    (for [i 2 (length ast)]
      (table.insert els (pick-values 1 (: (tostring (. ast i)) :gsub "\n" " "))))
      (table.insert els (pick-values 1 (view (. ast i) {:one-line? true}))))
    (compiler.emit parent (.. "-- " (table.concat els " ")) ast)))

(doc-special :comment ["..."] "Comment which will be emitted in Lua output." true)
-- 
2.31.1
Thanks! Applied this.

-Phil