summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2023-11-17 14:18:23 +0000
committerArun Isaac2023-11-17 16:08:43 +0000
commitadb7d89709fabe14791fe9b570d9db3e993d43f6 (patch)
tree778f88cc354d64912d24ad8a4d8b520242ec3b17
parentb1cff95e0360f7db8391763bba334aaac595dd41 (diff)
downloadccwl-adb7d89709fabe14791fe9b570d9db3e993d43f6.tar.gz
ccwl-adb7d89709fabe14791fe9b570d9db3e993d43f6.tar.lz
ccwl-adb7d89709fabe14791fe9b570d9db3e993d43f6.zip
ccwl: Recreate types using syntax.
* ccwl/ccwl.scm (type->syntax): New function.
(key->output): Use type->syntax.
-rw-r--r--ccwl/ccwl.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index 5ae0761..0127b3c 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -138,6 +138,13 @@ compared using @code{equal?}."
     (primitive-type
      #''primitive-type)))
 
+(define (type->syntax type)
+  "Return syntax to recreate @var{type}."
+  (if (array-type? type)
+      #`(make-array-type #,(type->syntax (array-type-member-type type)))
+      (with-syntax ((type (datum->syntax #f type)))
+        #''type)))
+
 (define (input input-spec)
   "Return syntax to build an <input> object from INPUT-SPEC."
   (syntax-case input-spec ()
@@ -749,8 +756,7 @@ commands."
       #`(make-output
          #,(with-syntax ((id (datum->syntax #f (output-id output))))
              #''id)
-         #,(with-syntax ((type (datum->syntax #f (output-type output))))
-             #''type)
+         #,(type->syntax (output-type output))
          #,(with-syntax ((binding (datum->syntax #f (output-binding output))))
              #''binding)
          #,(output-source output)