avoid depending on the message text for a cm-accomplice event

svn: r11355
This commit is contained in:
Matthew Flatt 2008-08-20 13:37:57 +00:00
parent 6516518ae5
commit de4352d8fc
3 changed files with 10 additions and 6 deletions

View File

@ -4,4 +4,7 @@
(define (register-external-file f)
(unless (and (path? f) (complete-path? f))
(raise-type-error 'register-external-file "complete path" f))
(log-message (current-logger) 'info "compilation dependency" f))
(log-message (current-logger)
'info
(format "file dependency: ~s" f)
`#s(file-dependency ,f)))

View File

@ -112,6 +112,7 @@
(define-struct ext-reader-guard (proc prev)
#:property prop:procedure (struct-field-index proc))
(define-struct file-dependency (path) #:prefab)
(define (compile-zo* mode path read-src-syntax zo-name)
;; External dependencies registered through reader guard and accomplice-logged events:
@ -136,9 +137,9 @@
(cond
[(eq? (vector-ref l 2) done-key) 'done]
[(and (eq? (vector-ref l 0) 'info)
(equal? "compilation dependency" (vector-ref l 1))
(path? (vector-ref l 2)))
(external-dep! (vector-ref l 2))
(file-dependency? (vector-ref l 2))
(path? (file-dependency-path (vector-ref l 2))))
(external-dep! (file-dependency-path (vector-ref l 2)))
(loop)]
[else
(log-message orig-log (vector-ref l 0) (vector-ref l 1) (vector-ref l 2))

View File

@ -250,8 +250,8 @@ A parameter for a procedure of one argument that is called to report
@defproc[(register-external-file [file (and path? complete-path?)]) void?]{
Logs a message (see @scheme[log-message]) at level @scheme['info]. The
message is @scheme["compilation dependency"], and the data associated
with the message is @scheme[file].
message data is a @schemeidfont{file-dependency} prefab structure type
with one field whose value is @scheme[file].
A compilation manager implemented by @schememodname[compiler/cm] looks
for such messages to register an external dependency. The compilation