move pattern-expander contracts to outer modules, trim exports
This avoids mysterious errors later in the build process related to TR and static-contracts. I don't see how the pattern-expander code could possibly cause the errors that occur, but this commit fixes them.
This commit is contained in:
parent
81cc6bf4d0
commit
3d5fcaa355
|
@ -1,5 +1,6 @@
|
|||
#lang racket/base
|
||||
(require racket/contract/base
|
||||
(require (for-syntax racket/base)
|
||||
racket/contract/base
|
||||
"parse/pre.rkt"
|
||||
"parse/experimental/provide.rkt"
|
||||
"parse/experimental/contract.rkt")
|
||||
|
@ -8,3 +9,16 @@
|
|||
expr/c)
|
||||
(provide-syntax-class/contract
|
||||
[static (syntax-class/c [(-> any/c any/c) (or/c string? symbol? #f)])])
|
||||
|
||||
(begin-for-syntax
|
||||
(require racket/contract/base
|
||||
"parse/private/pattern-expander-prop.rkt"
|
||||
"parse/private/pattern-expander.rkt")
|
||||
(provide pattern-expander?
|
||||
(contract-out
|
||||
[pattern-expander
|
||||
(-> (-> syntax? syntax?) pattern-expander?)]
|
||||
[prop:pattern-expander
|
||||
(struct-type-property/c (-> pattern-expander? (-> syntax? syntax?)))]
|
||||
[syntax-local-syntax-parse-pattern-introduce
|
||||
(-> syntax? syntax?)])))
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
#lang racket/base
|
||||
(require "private/sc.rkt"
|
||||
"private/litconv.rkt"
|
||||
"private/lib.rkt"
|
||||
(for-syntax "private/pattern-expander.rkt"))
|
||||
"private/lib.rkt")
|
||||
(provide (except-out (all-from-out "private/sc.rkt")
|
||||
define-integrable-syntax-class
|
||||
syntax-parser/template
|
||||
parser/rhs)
|
||||
(all-from-out "private/litconv.rkt")
|
||||
(all-from-out "private/lib.rkt")
|
||||
(for-syntax (all-from-out "private/pattern-expander.rkt")))
|
||||
(all-from-out "private/lib.rkt"))
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/contract/base)
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define-values (prop:pattern-expander pattern-expander? get-proc-getter)
|
||||
(make-struct-type-property 'pattern-expander))
|
||||
|
@ -16,16 +15,3 @@
|
|||
|
||||
(define (syntax-local-syntax-parse-pattern-introduce stx)
|
||||
((current-syntax-parse-pattern-introducer) stx))
|
||||
|
||||
(provide (contract-out
|
||||
[prop:pattern-expander
|
||||
(struct-type-property/c (-> pattern-expander? (-> syntax? syntax?)))]
|
||||
[pattern-expander?
|
||||
(-> any/c boolean?)]
|
||||
[pattern-expander-proc
|
||||
(-> pattern-expander? (-> syntax? syntax?))]
|
||||
[current-syntax-parse-pattern-introducer
|
||||
(parameter/c (-> syntax? syntax?))]
|
||||
[syntax-local-syntax-parse-pattern-introduce
|
||||
(-> syntax? syntax?)]
|
||||
))
|
||||
|
|
|
@ -1,25 +1,8 @@
|
|||
#lang racket/base
|
||||
(require (only-in "pattern-expander-prop.rkt" prop:pattern-expander))
|
||||
(provide pattern-expander)
|
||||
|
||||
(provide prop:pattern-expander
|
||||
pattern-expander
|
||||
pattern-expander?
|
||||
pattern-expander-proc
|
||||
syntax-local-syntax-parse-pattern-introduce
|
||||
)
|
||||
|
||||
(require "pattern-expander-prop.rkt")
|
||||
|
||||
(module pattern-expander-struct racket/base
|
||||
(require racket/contract/base)
|
||||
|
||||
(require (only-in "pattern-expander-prop.rkt" prop:pattern-expander))
|
||||
|
||||
(struct pattern-expander (proc) #:transparent
|
||||
#:property prop:pattern-expander
|
||||
(λ (this) (pattern-expander-proc this))) ; needs to be wrapped in (λ (this) (_ this))
|
||||
|
||||
(provide (contract-out
|
||||
[struct pattern-expander ([proc (-> syntax? syntax?)])]
|
||||
)))
|
||||
|
||||
(require (only-in 'pattern-expander-struct pattern-expander))
|
||||
(struct pattern-expander (proc) #:transparent
|
||||
#:omit-define-syntaxes ;; don't give indirect access to proc via match
|
||||
#:property prop:pattern-expander
|
||||
(λ (this) (pattern-expander-proc this))) ; needs to be wrapped in (λ (this) (_ this))
|
||||
|
|
Loading…
Reference in New Issue
Block a user