mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 20:20:24 +02:00
Properly display locations in "source vector" form.
Locations are stored in tree-il records in "source vector" form, but `location-string' was rendering these as <unknown-location>. * module/system/base/message.scm (location-string): Support locations passed as a file/line/column vector.
This commit is contained in:
parent
c746586de3
commit
eb5ecf4944
1 changed files with 13 additions and 6 deletions
|
@ -41,12 +41,19 @@
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (location-string loc)
|
(define (location-string loc)
|
||||||
(if (pair? loc)
|
(define (format-loc file line column)
|
||||||
(format #f "~a:~a:~a"
|
(format #f "~a:~a:~a"
|
||||||
(or (assoc-ref loc 'filename) "<stdin>")
|
(or file "<stdin>")
|
||||||
(1+ (assoc-ref loc 'line))
|
(1+ line)
|
||||||
(assoc-ref loc 'column))
|
column))
|
||||||
"<unknown-location>"))
|
(match loc
|
||||||
|
(#(file line column)
|
||||||
|
(format-loc file line column))
|
||||||
|
((? pair? loc)
|
||||||
|
(format-loc (assoc-ref loc 'filename)
|
||||||
|
(assoc-ref loc 'line)
|
||||||
|
(assoc-ref loc 'column)))
|
||||||
|
(_ "<unknown-location>")))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue