mirror of
https://github.com/janet-lang/janet
synced 2025-11-10 12:33:08 +00:00
Improve line and col tracking in parser.
Unconditionally add line and column information if a parsed value is a tuple - before, some parsed tuples had line and col information omitted.
This commit is contained in:
@@ -953,7 +953,7 @@
|
||||
(def [l c] (tuple/sourcemap (dyn :macro-form ())))
|
||||
(def cf (dyn :current-file))
|
||||
(def fmt-1 (if cf (string/format "trace [%s]" cf) "trace"))
|
||||
(def fmt-2 (if (or (neg? l) (neg? c)) ": " (string/format " on line %d, column %d:" l c)))
|
||||
(def fmt-2 (if (or (neg? l) (neg? c)) ":" (string/format " on line %d, column %d:" l c)))
|
||||
(def fmt (string fmt-1 fmt-2 " %j is "))
|
||||
(def s (gensym))
|
||||
~(let [,s ,x]
|
||||
|
||||
Reference in New Issue
Block a user