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:
Matthew Flatt 2019-11-28 05:51:48 -07:00
parent 8b00249265
commit a410905c99

View File

@ -88,6 +88,7 @@
find-system-path
build-path
format
error-print-source-location
;; Used by cross-compiler:
get-original-error-port
subprocess
@ -844,6 +845,8 @@
"importing instance" (unquoted-printing-string (format "~a" (instance-name target-inst)))))
(define (identify-module var)
(cond
[(error-print-source-location)
(let ([i (car (variable-inst-box var))])
(cond
[(eq? i #!bwp)
@ -851,7 +854,8 @@
[(instance-name i)
=> (lambda (name)
(#%format "\n module: ~a" name))]
[else ""])))
[else ""]))]
[else ""]))
(define (raise-undefined var set?)
(raise