Add logging to typechecker main loop.
This commit is contained in:
parent
c25f7cea27
commit
41bfb878c3
|
@ -252,7 +252,6 @@
|
|||
[_ (int-err "not define-type-alias")]))
|
||||
|
||||
(define (type-check forms0)
|
||||
(begin-with-definitions
|
||||
(define forms (syntax->list forms0))
|
||||
(define-values (type-aliases struct-defs stx-defs0 val-defs0 provs reqs)
|
||||
(filter-multiple
|
||||
|
@ -264,20 +263,25 @@
|
|||
parse-def
|
||||
provide?
|
||||
define/fixup-contract?))
|
||||
(do-time "Form splitting done")
|
||||
(for-each (compose register-type-alias parse-type-alias) type-aliases)
|
||||
;; add the struct names to the type table
|
||||
(for-each (compose add-type-name! names-of-struct) struct-defs)
|
||||
;; resolve all the type aliases, and error if there are cycles
|
||||
(resolve-type-aliases parse-type)
|
||||
(do-time "Starting pass1")
|
||||
;; do pass 1, and collect the defintions
|
||||
(define defs (apply append (filter list? (map tc-toplevel/pass1 forms))))
|
||||
(do-time "Finished pass1")
|
||||
;; separate the definitions into structures we'll handle for provides
|
||||
(define def-tbl
|
||||
(for/fold ([h (make-immutable-free-id-table)])
|
||||
([def (in-list defs)])
|
||||
(dict-set h (binding-name def) def)))
|
||||
;; typecheck the expressions and the rhss of defintions
|
||||
(do-time "Starting pass2")
|
||||
(for-each tc-toplevel/pass2 forms)
|
||||
(do-time "Finished pass2")
|
||||
;; check that declarations correspond to definitions
|
||||
(check-all-registered-types)
|
||||
;; report delayed errors
|
||||
|
@ -311,6 +315,7 @@
|
|||
[_ (int-err "unknown provide form")])))]
|
||||
[_ (int-err "non-provide form! ~a" (syntax->datum p))])))
|
||||
;; compute the new provides
|
||||
(define new-stx
|
||||
(with-syntax*
|
||||
([the-variable-reference (generate-temporary #'blame)]
|
||||
[(new-provs ...)
|
||||
|
@ -323,7 +328,9 @@
|
|||
#,(tname-env-init-code)
|
||||
#,(talias-env-init-code)
|
||||
(begin-for-syntax #,(make-struct-table-code))
|
||||
(begin new-provs ...)))))
|
||||
(begin new-provs ...))))
|
||||
(do-time "finished provide generation")
|
||||
new-stx)
|
||||
|
||||
;; typecheck a whole module
|
||||
;; syntax -> syntax
|
||||
|
|
Loading…
Reference in New Issue
Block a user