mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-09 22:17:33 +02:00
Allow passing more args to error/loc
This commit is contained in:
parent
6d30e7449b
commit
c37e8dfad9
1 changed files with 4 additions and 4 deletions
|
@ -235,7 +235,7 @@
|
||||||
)
|
)
|
||||||
(begin
|
(begin
|
||||||
(define *source-loc-lis* '())
|
(define *source-loc-lis* '())
|
||||||
(define (error/loc reason expr)
|
(define (error/loc reason expr . args)
|
||||||
(let* ((found (assoc expr *source-loc-lis*))
|
(let* ((found (assoc expr *source-loc-lis*))
|
||||||
(loc-vec (if found
|
(loc-vec (if found
|
||||||
(cdr found) ;; Get value
|
(cdr found) ;; Get value
|
||||||
|
@ -251,10 +251,10 @@
|
||||||
(number->string (vector-ref loc-vec 2))
|
(number->string (vector-ref loc-vec 2))
|
||||||
") "
|
") "
|
||||||
reason)
|
reason)
|
||||||
expr)
|
(if (pair? args) args expr))
|
||||||
(error
|
(error
|
||||||
reason
|
reason
|
||||||
expr))))
|
(if (pair? args) args expr))))
|
||||||
|
|
||||||
;; Features implemented by this Scheme
|
;; Features implemented by this Scheme
|
||||||
(define (features)
|
(define (features)
|
||||||
|
@ -401,7 +401,7 @@
|
||||||
(cond
|
(cond
|
||||||
((symbol? i) (symbol->string i))
|
((symbol? i) (symbol->string i))
|
||||||
((number? i) (number->string i))
|
((number? i) (number->string i))
|
||||||
(else (error "Unexpected type in import set")))))
|
(else (error/loc "Unexpected type in import set" expr)))))
|
||||||
import))
|
import))
|
||||||
file-ext))
|
file-ext))
|
||||||
(filename
|
(filename
|
||||||
|
|
Loading…
Add table
Reference in a new issue