cs: module in some error messages only when enabled
Check `(error-print-source-location)` before adding a module name in an error message about use/set before definition.
This commit is contained in:
parent
8b00249265
commit
a410905c99
|
@ -88,6 +88,7 @@
|
||||||
find-system-path
|
find-system-path
|
||||||
build-path
|
build-path
|
||||||
format
|
format
|
||||||
|
error-print-source-location
|
||||||
;; Used by cross-compiler:
|
;; Used by cross-compiler:
|
||||||
get-original-error-port
|
get-original-error-port
|
||||||
subprocess
|
subprocess
|
||||||
|
@ -844,14 +845,17 @@
|
||||||
"importing instance" (unquoted-printing-string (format "~a" (instance-name target-inst)))))
|
"importing instance" (unquoted-printing-string (format "~a" (instance-name target-inst)))))
|
||||||
|
|
||||||
(define (identify-module var)
|
(define (identify-module var)
|
||||||
(let ([i (car (variable-inst-box var))])
|
(cond
|
||||||
(cond
|
[(error-print-source-location)
|
||||||
[(eq? i #!bwp)
|
(let ([i (car (variable-inst-box var))])
|
||||||
""]
|
(cond
|
||||||
[(instance-name i)
|
[(eq? i #!bwp)
|
||||||
=> (lambda (name)
|
""]
|
||||||
(#%format "\n module: ~a" name))]
|
[(instance-name i)
|
||||||
[else ""])))
|
=> (lambda (name)
|
||||||
|
(#%format "\n module: ~a" name))]
|
||||||
|
[else ""]))]
|
||||||
|
[else ""]))
|
||||||
|
|
||||||
(define (raise-undefined var set?)
|
(define (raise-undefined var set?)
|
||||||
(raise
|
(raise
|
||||||
|
|
Loading…
Reference in New Issue
Block a user