|
42 | 42 | identifier? identifier? |
43 | 43 | (values syntax? syntax? identifier? (listof (list/c identifier? identifier?)))) |
44 | 44 | (match-define (def-binding internal-id ty) me) |
45 | | - (with-syntax* ([id internal-id] |
46 | | - [untyped-id (freshen-id #'id)] |
47 | | - [local-untyped-id (freshen-id #'id)] |
48 | | - [export-id new-id]) |
49 | | - (define/with-syntax ctc (generate-temporary 'generated-contract)) |
50 | | - ;; Create the definitions of the contract and the contracted export. |
51 | | - (define/with-syntax definitions |
52 | | - (contract-def/provide-property |
53 | | - #'(define-values (ctc) #f) |
54 | | - (list ty #'untyped-id #'id pos-blame-id))) |
55 | | - (values |
56 | | - ;; For the submodule |
57 | | - #`(begin definitions (provide untyped-id)) |
58 | | - ;; For the main module |
59 | | - #`(begin (define-syntax local-untyped-id (#,mk-redirect-id (quote-syntax untyped-id))) |
60 | | - (define-syntax export-id |
61 | | - (make-typed-renaming #'id #'local-untyped-id))) |
62 | | - new-id |
63 | | - null)))]) |
| 45 | + (with-syntax* ([id internal-id] |
| 46 | + [untyped-id (freshen-id #'id)] |
| 47 | + [local-untyped-id (freshen-id #'id)] |
| 48 | + [export-id new-id]) |
| 49 | + (define/with-syntax ctc (generate-temporary 'generated-contract)) |
| 50 | + ;; Create the definitions of the contract and the contracted export. |
| 51 | + (define/with-syntax definitions |
| 52 | + (contract-def/provide-property |
| 53 | + #'(define-values (ctc) #f) |
| 54 | + (list ty #'untyped-id #'id pos-blame-id))) |
| 55 | + (values |
| 56 | + ;; For the submodule |
| 57 | + #`(begin definitions (provide untyped-id)) |
| 58 | + ;; For the main module |
| 59 | + #`(begin (define-syntax local-untyped-id (#,mk-redirect-id (quote-syntax untyped-id))) |
| 60 | + (define-syntax export-id |
| 61 | + (make-typed-renaming #'id #'local-untyped-id))) |
| 62 | + new-id |
| 63 | + null)))]) |
64 | 64 |
|
65 | 65 | (define-struct (def-stx-binding binding) () #:transparent |
66 | 66 | #:methods gen:providable |
|
107 | 107 | (mk-ignored-quad e)))) |
108 | 108 |
|
109 | 109 | (define sname-is-constructor? (and (or extra-constr-name (free-identifier=? sname constructor-name)) #t)) |
110 | | - (define constr (or extra-constr-name constr^)) |
| 110 | + (define constr (or extra-constr-name constructor-name)) |
111 | 111 | (define type-is-sname? (free-identifier=? tname internal-id)) |
| 112 | + |
112 | 113 | ;; Here, we recursively handle all of the identifiers referenced |
113 | 114 | ;; in this static struct info. |
114 | 115 | (define-values (constr-defn constr-export-defn constr-new-id constr-aliases) |
|
118 | 119 | ;; avoid generating the quad for constr twice. |
119 | 120 | ;; skip it when the binding is for the type name |
120 | 121 | [(and (free-identifier=? internal-id sname) (free-identifier=? constr internal-id)) |
121 | | - (super-mk-quad (make-def-binding constr constr-type) (freshen-id constr) def-tbl pos-blame-id mk-redirect-id)] |
| 122 | + (super-mk-quad (make-def-binding constr constr-type) |
| 123 | + (freshen-id constr) def-tbl pos-blame-id |
| 124 | + mk-redirect-id)] |
122 | 125 | [else |
123 | 126 | (make-quad constr def-tbl pos-blame-id mk-redirect-id)])) |
124 | 127 |
|
|
181 | 184 | ;; def-tbl, pos-blame-id, and mk-redirect-id |
182 | 185 | (define/cond-contract (make-quad internal-id def-tbl pos-blame-id mk-redirect-id) |
183 | 186 | (-> identifier? (free-id-table/c identifier? binding? #:immutable #t) identifier? identifier? |
184 | | - (values syntax? syntax? identifier? (listof (list/c identifier? identifier?)))) |
| 187 | + (values syntax? syntax? identifier? (listof (list/c identifier? identifier?)))) |
185 | 188 | (define new-id (freshen-id internal-id)) |
186 | 189 | (cond |
187 | 190 | ;; if it's already done, do nothing |
|
0 commit comments