Skip to content

Commit 8505f6e

Browse files
committed
val-decl: add exact? field
1 parent 42cf771 commit 8505f6e

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

hackett-lib/hackett/private/base.rkt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,23 +327,26 @@
327327

328328
(begin-for-syntax
329329
; fixity : [Maybe Fixity]
330-
(struct val-decl [internal-id type fixity]
330+
(struct val-decl [internal-id type exact? fixity]
331331
#:property prop:procedure
332332
(λ (this stx)
333-
(match-define (val-decl x- type _) this)
333+
(match-define (val-decl x- type _ _) this)
334334
((make-typed-var-transformer x- type) stx))
335335
#:property prop:infix-operator
336336
(λ (this) (val-decl-fixity this)))
337337

338338
(define-syntax-class id/val-decl
339-
#:attributes [internal-id type.expansion type.scoped-binding-introducer]
339+
#:attributes [internal-id
340+
type.expansion type.scoped-binding-introducer
341+
exact?
342+
fixity]
340343
[pattern (~var x (local-value val-decl?))
341-
#:attr internal-id
342-
(syntax-local-introduce
343-
(val-decl-internal-id (attribute x.local-value)))
344-
#:with type:type
345-
(syntax-local-introduce
346-
(val-decl-type (attribute x.local-value)))]))
344+
#:do [(match-define (val-decl x-* type* exact?* fixity*)
345+
(attribute x.local-value))]
346+
#:attr internal-id (syntax-local-introduce x-*)
347+
#:with type:type (syntax-local-introduce type*)
348+
#:attr exact? exact?*
349+
#:attr fixity fixity*]))
347350

348351
;; ---------------------------------------------------------------------------------------------------
349352

@@ -399,6 +402,7 @@
399402
{~optional f:fixity-annotation}}
400403
...)
401404
#:with x- (generate-temporary #'x)
405+
#:with exct? (and (attribute exact?) #true)
402406
#:with fixity (attribute f.fixity)
403407
#:with t_reduced (if (attribute exact?)
404408
#'t.expansion
@@ -407,6 +411,7 @@
407411
(let-values ([() t.residual])
408412
(val-decl (quote-syntax x-)
409413
(quote-syntax t_reduced)
414+
'exct?
410415
'fixity)))])])))
411416

412417
(define-syntax-parser λ1

0 commit comments

Comments
 (0)