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
|
||||
(define *source-loc-lis* '())
|
||||
(define (error/loc reason expr)
|
||||
(define (error/loc reason expr . args)
|
||||
(let* ((found (assoc expr *source-loc-lis*))
|
||||
(loc-vec (if found
|
||||
(cdr found) ;; Get value
|
||||
|
@ -251,10 +251,10 @@
|
|||
(number->string (vector-ref loc-vec 2))
|
||||
") "
|
||||
reason)
|
||||
expr)
|
||||
(if (pair? args) args expr))
|
||||
(error
|
||||
reason
|
||||
expr))))
|
||||
(if (pair? args) args expr))))
|
||||
|
||||
;; Features implemented by this Scheme
|
||||
(define (features)
|
||||
|
@ -401,7 +401,7 @@
|
|||
(cond
|
||||
((symbol? i) (symbol->string i))
|
||||
((number? i) (number->string i))
|
||||
(else (error "Unexpected type in import set")))))
|
||||
(else (error/loc "Unexpected type in import set" expr)))))
|
||||
import))
|
||||
file-ext))
|
||||
(filename
|
||||
|
|
Loading…
Add table
Reference in a new issue