~technomancy/fennel

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

[PATCH] Indent traceback frames with one tab instead of two spaces

Rudolf Adamkovič <salutis@me.com>
Details
Message ID
<20240131094834.83399-1-salutis@me.com>
DKIM signature
pass
Download raw message
Patch: +4 -4
This is to improve tooling support.  For example, the Compilation mode in Emacs
fontifies Lua tracebacks, and with this change, we it works for Fennel too.
---
 src/fennel/compiler.fnl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/fennel/compiler.fnl b/src/fennel/compiler.fnl
index 879ffa8..60a902c 100644
--- a/src/fennel/compiler.fnl
+++ b/src/fennel/compiler.fnl
@@ -869,9 +869,9 @@ which we have to do if we don't know."

(fn traceback-frame [info]
  (if (and (= info.what :C) info.name)
      (string.format "  [C]: in function '%s'" info.name)
      (string.format "\t[C]: in function '%s'" info.name)
      (= info.what :C)
      "  [C]: in ?"
      "\t[C]: in ?"
      (let [remap (. sourcemap info.source)]
        (when (and remap (. remap info.currentline))
          ;; And some global info
@@ -883,12 +883,12 @@ which we have to do if we don't know."
          ;; Overwrite info with values from the mapping
          (set info.currentline (or (. remap info.currentline 2) -1)))
        (if (= info.what :Lua)
            (string.format "  %s:%d: in function %s" info.short_src
            (string.format "\t%s:%d: in function %s" info.short_src
                           info.currentline
                           (if info.name (.. "'" info.name "'") "?"))
            (= info.short_src "(tail call)")
            "  (tail call)"
            (string.format "  %s:%d: in main chunk" info.short_src
            (string.format "\t%s:%d: in main chunk" info.short_src
                           info.currentline)))))

(fn traceback [?msg ?start]
-- 
2.43.0
Details
Message ID
<87sf2aiye1.fsf@hagelb.org>
In-Reply-To
<20240131094834.83399-1-salutis@me.com> (view parent)
DKIM signature
pass
Download raw message
Rudolf Adamkovič <salutis@me.com> writes:

> This is to improve tooling support.  For example, the Compilation mode in Emacs
> fontifies Lua tracebacks, and with this change, we it works for Fennel too.

Makes sense to keep it consistent with Lua's formatting; thanks.

Applied the patch.

-Phil
Reply to thread Export thread (mbox)