summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-02-07 08:58:57 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commit1fb1330efe171fd7ecbb94f901a3c43592b0a2d5 (patch)
tree0afdd4c331e3d1ff9fb036bcc274f9953adf239e
parent94b7c240720ac3a561ff91106c7698b25cd5179b (diff)
Allow multi-dimensional arrays.
-rw-r--r--chickadee/graphics/seagull.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm
index 4488c04..a1adb1d 100644
--- a/chickadee/graphics/seagull.scm
+++ b/chickadee/graphics/seagull.scm
@@ -1947,8 +1947,13 @@
('mat3 type:mat3)
('mat4 type:mat4)
('sampler-2d type:sampler-2d)
- (('array desc* (? exact-integer? length))
- (array-type (type-descriptor->type desc*) length))))
+ (('array desc* (? exact-integer? length) (? exact-integer? rest) ...)
+ (let loop ((rest rest)
+ (prev (array-type (type-descriptor->type desc*) length)))
+ (match rest
+ (() prev)
+ ((length . rest)
+ (loop rest (array-type prev length))))))))
(define-syntax-rule (a+b->c (ta tb tc) ...)
(let ((a (fresh-variable-type))