File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 10
10
review-syntax)
11
11
12
12
(define (should-review-syntax? stx)
13
- (syntax-case stx (define-schema)
13
+ (syntax-case stx (define-schema define-type )
14
14
[(define-schema . _rest) #t ]
15
+ [(define-type . _rest) #t ]
15
16
[_ #f ]))
16
17
17
18
(define-splicing-syntax-class schema-field-option
56
57
#:check-usages? #f
57
58
(format "~a~a-~~a " p schema-id-sym))))]))
58
59
60
+ (define-syntax-class type-definition
61
+ #:datum-literals (define-type)
62
+ (pattern (define-type
63
+ ~!
64
+ type-id:id
65
+ {~do (push-scope)}
66
+ {~optional (field-id:id ... )}
67
+ {~alt {~optional {~seq {~or #:contract
68
+ #:contract-fn }
69
+ contract-expr:expression}}
70
+ {~optional {~seq #:declaration declaration-expr:expression}}
71
+ {~optional {~seq #:constructor constructor-expr:expression}}
72
+ {~optional {~seq #:dump dump-expr:expression}}
73
+ {~optional {~seq #:load load-expr:expression}}} ... )
74
+ #:do [(pop-scope)
75
+ (track-binding #'type-id "~a/f " #:check-usages? #f )
76
+ (track-binding #'type-id "~a/f? " #:check-usages? #f )]))
77
+
59
78
(define (review-syntax stx)
60
79
(syntax-parse stx
61
80
[d:schema-definition #'d ]
62
- [_ (track-error stx "expected a deta schema definition " )]))
81
+ [t:type-definition #'t ]
82
+ [_ (track-error stx "expected a deta schema or type definition " )]))
You can’t perform that action at this time.
0 commit comments