summaryrefslogtreecommitdiff
path: root/Lisp/type-conversion.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-14 01:24:30 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-14 01:24:30 +0200
commitdf309e5a4372776aada9d27c9f8427609a824490 (patch)
treeca2c9836c6490a61ab5f51cdd6241901dfc735dc /Lisp/type-conversion.lisp
parentc5f208daed4eb63d5a8ff3f8a92bac2a9df08002 (diff)
Add support for opaque structs and unions in typespecs.
darcs-hash:70b517357c9dab4bbf35c374003187f8433a353e
Diffstat (limited to 'Lisp/type-conversion.lisp')
-rw-r--r--Lisp/type-conversion.lisp27
1 files changed, 23 insertions, 4 deletions
diff --git a/Lisp/type-conversion.lisp b/Lisp/type-conversion.lisp
index 05bb08e..715e906 100644
--- a/Lisp/type-conversion.lisp
+++ b/Lisp/type-conversion.lisp
@@ -102,14 +102,33 @@ Returns: (VALUES typespec byte-position string-position)"
(push qualifier qualifiers))))
(values (case init-char
((#\{ #\()
- (let ((name-end (position #\= typestring :start start)))
+ (let* ((=-token (position #\= typestring :start start))
+ (name-end (or =-token
+ ;; An opaque struct whose contents
+ ;; we don't know.
+ (position (ecase init-char
+ (#\{ #\})
+ (#\( #\)))
+ typestring
+ :start start)
+ (error "Premature end of file in~
+ typespec: ~A."
+ typestring)))
+ (struct-name (subseq typestring
+ (1+ string-position)
+ name-end)))
(list* (ecase init-char
(#\{ 'struct)
(#\( 'union))
- qualifiers
- (subseq typestring (1+ start) name-end)
+ (if =-token
+ qualifiers
+ (cons 'opaque qualifiers))
+ struct-name
(progn
- (setq string-position (1+ name-end)) ; skip #\=
+ (setq string-position
+ (if =-token
+ (1+ name-end) ; skip #\=
+ name-end))
(loop until (char= (char typestring string-position)
(ecase init-char
(#\{ #\})