Remove tc-toplevel from the typechecking unit.

original commit: 986318065d71817c59c9571e72fe8abcce4944cd
This commit is contained in:
Sam Tobin-Hochstadt 2010-05-24 14:03:14 -07:00
parent 5ba6d3297f
commit af4ff86f52
4 changed files with 15 additions and 17 deletions

View File

@ -6,10 +6,6 @@
(types utils))
(provide (all-defined-out))
(define-signature typechecker^
([cnt type-check (syntax? . -> . syntax?)]
[cnt tc-toplevel-form (syntax? . -> . any)]))
(define-signature tc-expr^
([cnt tc-expr (syntax? . -> . tc-results?)]
[cnt tc-literal (->* (syntax?) ((or/c #f Type/c)) Type/c)]

View File

@ -1,31 +1,33 @@
#lang scheme/unit
#lang racket/base
(require (rename-in "../utils/utils.rkt" [infer r:infer]))
(require syntax/kerncase
unstable/list unstable/syntax syntax/parse unstable/debug
(require (rename-in "../utils/utils.rkt" [infer r:infer])
syntax/kerncase
unstable/list unstable/syntax syntax/parse unstable/debug
mzlib/etc
scheme/match
"signatures.rkt"
"tc-structs.rkt"
"typechecker.rkt"
;; to appease syntax-parse
"internal-forms.rkt"
(rep type-rep)
(types utils convenience)
(private parse-type type-annotation type-contract)
(env type-env init-envs type-name-env type-alias-env lexical-env)
unstable/mutated-vars syntax/id-table
unstable/mutated-vars syntax/id-table
(utils tc-utils)
"provide-handling.rkt"
"def-binding.rkt"
(prefix-in c: racket/contract)
(for-template
"internal-forms.rkt"
unstable/location
mzlib/contract
scheme/base))
(import tc-expr^ check-subforms^)
(export typechecker^)
(c:provide/contract
[type-check (syntax? . c:-> . syntax?)]
[tc-toplevel-form (syntax? . c:-> . c:any/c)])
(define unann-defs (make-free-id-table))

View File

@ -6,12 +6,12 @@
(only-in scheme/unit
provide-signature-elements
define-values/invoke-unit/infer link)
"signatures.rkt" "tc-toplevel.rkt"
"signatures.rkt"
"tc-if.rkt" "tc-lambda-unit.rkt" "tc-app.rkt"
"tc-let-unit.rkt" "tc-dots-unit.rkt"
"tc-expr-unit.rkt" "check-subforms-unit.rkt")
(provide-signature-elements typechecker^ tc-expr^)
(provide-signature-elements tc-expr^ check-subforms^)
(define-values/invoke-unit/infer
(link tc-toplevel@ tc-if@ tc-lambda@ tc-dots@ tc-app@ tc-let@ tc-expr@ check-subforms@))
(link tc-if@ tc-lambda@ tc-dots@ tc-app@ tc-let@ tc-expr@ check-subforms@))

View File

@ -8,7 +8,7 @@
scheme/base
(private type-contract optimize)
(types utils convenience)
(typecheck typechecker provide-handling)
(typecheck typechecker provide-handling tc-toplevel)
(env type-environments type-name-env type-alias-env)
(r:infer infer)
(utils tc-utils)
@ -43,7 +43,7 @@
([(lambda (e) (and catch-errors? (exn:fail? e) (not (exn:fail:syntax? e))))
(lambda (e) (tc-error "Internal error: ~a" e))])]
[parameterize (;; enable fancy printing?
[custom-printer #t]
[custom-printer #f]
;; a cheat to avoid units
[infer-param infer]
;; do we report multiple errors