summaryrefslogtreecommitdiff
path: root/bstruct.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2024-11-23 10:39:19 -0500
committerDavid Thompson <dthompson2@worcester.edu>2024-11-23 10:42:28 -0500
commitfaca7af5916d07a342d0c6076c2ea6a5610a81a9 (patch)
treeb65ab7ce4e872125ee7b04797daa7093c77b8903 /bstruct.scm
parent8aff7a348967bafa5deeea10916d72370888a7d5 (diff)
Fix opaque types.
Diffstat (limited to 'bstruct.scm')
-rw-r--r--bstruct.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/bstruct.scm b/bstruct.scm
index df5163a..8efe98b 100644
--- a/bstruct.scm
+++ b/bstruct.scm
@@ -693,6 +693,10 @@
(symbolic-match? pointer)
#`(make-pointer size align #,(build-type #'desc)))))
(syntax-case stx ()
+ ;; Opaque types have no descriptor.
+ ((_ id name (opaque))
+ (symbolic-match? opaque)
+ #'(define id #f))
((_ id name layout . kwargs)
(with-syntax ((type (build-type #'layout)))
#`(define id (make-bstruct-descriptor 'name type . kwargs)))))))
@@ -1176,6 +1180,9 @@
(type-id
(bstruct-descriptor-identifier? #'type-id)
#'type-id)
+ ((opaque)
+ (symbolic-match? opaque)
+ expr)
(primitive
(identifier-memq? #'primitive primitives)
(let ((type (syntax->datum #'primitive)))
@@ -1357,7 +1364,7 @@
(with-syntax ((((expr . kwargs) ...)
(map (lambda (stx)
(syntax-case stx ()
- (() #'(opaque))
+ (() #'((opaque)))
(_ stx)))
#'(args ...))))
#'(define-bstruct* (id expr . kwargs) ...)))