diff --git a/typed-racket-lib/typed-racket/base-env/ann-inst.rkt b/typed-racket-lib/typed-racket/base-env/ann-inst.rkt index 0b99fa5f..0cc64a33 100644 --- a/typed-racket-lib/typed-racket/base-env/ann-inst.rkt +++ b/typed-racket-lib/typed-racket/base-env/ann-inst.rkt @@ -5,7 +5,7 @@ ;; This file is loaded by all Typed Racket programs, so it should not ;; have expensive runtime dependencies. -(require (for-syntax syntax/parse "../private/syntax-properties.rkt" +(require (for-syntax syntax/parse/pre "../private/syntax-properties.rkt" racket/base) "colon.rkt") diff --git a/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt b/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt index 21d21358..bd3ebabd 100644 --- a/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt +++ b/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require syntax/parse +(require syntax/parse/pre syntax/parse/experimental/template "../private/parse-classes.rkt" "../private/syntax-properties.rkt" diff --git a/typed-racket-lib/typed-racket/base-env/case-lambda.rkt b/typed-racket-lib/typed-racket/base-env/case-lambda.rkt index 70eb34f9..dde08379 100644 --- a/typed-racket-lib/typed-racket/base-env/case-lambda.rkt +++ b/typed-racket-lib/typed-racket/base-env/case-lambda.rkt @@ -9,7 +9,7 @@ (require (for-syntax "annotate-classes.rkt" "../private/syntax-properties.rkt" racket/base - syntax/parse)) + syntax/parse/pre)) (provide (rename-out [-case-lambda case-lambda] [-case-lambda case-lambda:]) diff --git a/typed-racket-lib/typed-racket/base-env/colon.rkt b/typed-racket-lib/typed-racket/base-env/colon.rkt index ba6c7fb6..b14af4bc 100644 --- a/typed-racket-lib/typed-racket/base-env/colon.rkt +++ b/typed-racket-lib/typed-racket/base-env/colon.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require (for-syntax racket/base syntax/parse unstable/syntax +(require (for-syntax racket/base syntax/parse/pre unstable/syntax "../private/parse-classes.rkt" "../utils/disappeared-use.rkt" (only-in "../utils/tc-utils.rkt" tc-error/stx)) diff --git a/typed-racket-lib/typed-racket/base-env/for-clauses.rkt b/typed-racket-lib/typed-racket/base-env/for-clauses.rkt index 2f8717fe..458bef7e 100644 --- a/typed-racket-lib/typed-racket/base-env/for-clauses.rkt +++ b/typed-racket-lib/typed-racket/base-env/for-clauses.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require syntax/parse +(require syntax/parse/pre (for-template (only-in racket/base quote)) "annotate-classes.rkt") diff --git a/typed-racket-lib/typed-racket/base-env/prims-contract.rkt b/typed-racket-lib/typed-racket/base-env/prims-contract.rkt index f9791d6b..9668205b 100644 --- a/typed-racket-lib/typed-racket/base-env/prims-contract.rkt +++ b/typed-racket-lib/typed-racket/base-env/prims-contract.rkt @@ -53,7 +53,7 @@ (rename-in racket/contract/base [-> c->] [->* c->*] [case-> c:case->]))) (require racket/lazy-require - syntax/parse + syntax/parse/pre syntax/stx racket/syntax unstable/syntax diff --git a/typed-racket-lib/typed-racket/base-env/prims-struct.rkt b/typed-racket-lib/typed-racket/base-env/prims-struct.rkt index 53880297..de293bea 100644 --- a/typed-racket-lib/typed-racket/base-env/prims-struct.rkt +++ b/typed-racket-lib/typed-racket/base-env/prims-struct.rkt @@ -13,9 +13,8 @@ "colon.rkt" "base-types-extra.rkt" "ann-inst.rkt" - (for-syntax racket/base syntax/parse + (for-syntax racket/base syntax/parse/pre racket/lazy-require - syntax/parse/experimental/template syntax/stx racket/list racket/syntax diff --git a/typed-racket-lib/typed-racket/base-env/prims.rkt b/typed-racket-lib/typed-racket/base-env/prims.rkt index c2c20958..5ffaf4c8 100644 --- a/typed-racket-lib/typed-racket/base-env/prims.rkt +++ b/typed-racket-lib/typed-racket/base-env/prims.rkt @@ -118,7 +118,7 @@ the typed racket language. (only-in racket/base values)) (for-syntax racket/lazy-require - syntax/parse + syntax/parse/pre syntax/parse/experimental/template syntax/stx racket/list diff --git a/typed-racket-lib/typed-racket/types/numeric-predicates.rkt b/typed-racket-lib/typed-racket/types/numeric-predicates.rkt index c3bc338e..ae3514df 100644 --- a/typed-racket-lib/typed-racket/types/numeric-predicates.rkt +++ b/typed-racket-lib/typed-racket/types/numeric-predicates.rkt @@ -1,7 +1,7 @@ #lang racket/base (require racket/unsafe/ops - racket/performance-hint) + (submod racket/performance-hint begin-encourage-inline)) (provide index? exact-rational?) diff --git a/typed-racket-lib/typed-racket/utils/tc-utils.rkt b/typed-racket-lib/typed-racket/utils/tc-utils.rkt index 1d644d26..e316535b 100644 --- a/typed-racket-lib/typed-racket/utils/tc-utils.rkt +++ b/typed-racket-lib/typed-racket/utils/tc-utils.rkt @@ -6,8 +6,8 @@ don't depend on any other portion of the system |# (require syntax/source-syntax "disappeared-use.rkt" - racket/match racket/promise racket/string - syntax/parse (for-syntax racket/base syntax/parse) + racket/promise racket/string + syntax/parse/pre (for-syntax racket/base syntax/parse/pre) (only-in unstable/sequence in-slice)) (provide ;; parameters @@ -113,40 +113,40 @@ don't depend on any other portion of the system (define (reset-errors!) (set! delayed-errors null)) (define (report-first-error) - (match (reverse delayed-errors) - [(list) (void)] - [(cons (struct err (msg stx)) _) - (reset-errors!) - (raise-typecheck-error msg stx)])) + (define r (reverse delayed-errors)) + (unless (null? r) + (define f (car r)) + (reset-errors!) + (raise-typecheck-error (err-msg f) (err-stx f)))) (define (report-all-errors) - (match (reverse delayed-errors) - [(list) (void)] - ;; if there's only one, we don't need multiple-error handling - [(list (struct err (msg stx))) - (reset-errors!) - (log-type-error msg stx) - (raise-typecheck-error msg stx)] - [l - (let ([stxs - (for/list ([e (in-list l)]) - (with-handlers ([exn:fail:syntax? - (λ (e) ((error-display-handler) (exn-message e) e))]) - (log-type-error (err-msg e) (err-stx e)) - (raise-typecheck-error (err-msg e) (err-stx e))) - (err-stx e))]) - (reset-errors!) - (unless (null? stxs) - (raise-typecheck-error (format "Summary: ~a errors encountered" - (length stxs)) - (apply append stxs))))])) + (define l (reverse delayed-errors)) + (cond [(null? l) (void)] + ;; if there's only one, we don't need multiple-error handling + [(null? (cdr l)) + (define f (car l)) + (reset-errors!) + (log-type-error (err-msg f) (err-stx f)) + (raise-typecheck-error (err-msg f) (err-stx f))] + [else (let ([stxs + (for/list ([e (in-list l)]) + (with-handlers ([exn:fail:syntax? + (λ (e) ((error-display-handler) (exn-message e) e))]) + (log-type-error (err-msg e) (err-stx e)) + (raise-typecheck-error (err-msg e) (err-stx e))) + (err-stx e))]) + (reset-errors!) + (unless (null? stxs) + (raise-typecheck-error (format "Summary: ~a errors encountered" + (length stxs)) + (apply append stxs))))])) ;; Returns #t if there's a type error recorded at the same position as ;; the given syntax object. Does not return a useful result if the ;; source, position, or span are #f. (define (error-at-stx-loc? stx) (for/or ([an-err (in-list delayed-errors)]) - (match-define (struct err (_ stxes)) an-err) + (define stxes (err-stx an-err)) (define stx* (and (not (null? stxes)) (car stxes))) (and stx* (equal? (syntax-source stx*) (syntax-source stx)) @@ -215,7 +215,8 @@ don't depend on any other portion of the system (define-values (field-strs vals) (for/fold ([field-strs null] [vals null]) ([field+value (in-slice 2 rst)]) - (match-define (list field value) field+value) + (define field (car field+value)) + (define value (cadr field+value)) (define field-strs* (cons (format " ~a: ~~a" field) field-strs)) (values field-strs* (cons value vals))))