read every trailing array bound as a dimension

[m 1 2] lost its second index, and [int 2 3] came out int 2 x[3]. Each
index now subscripts what the one before it gave, and [int 2 3] declares
what it indexes, int[2][3]. An inline struct's fields, once more than
one bound was looked for, were taken for one; their shape tells them apart.
This commit is contained in:
2026-10-16 15:26:05 +03:00
parent 65aaf69835
commit 9d5cd66514
7 changed files with 99 additions and 14 deletions

View File

@@ -214,7 +214,7 @@
;;; way the C writer unwraps them, so `[int 16]' and `[(int) 16]' are
;;; one type.
(define (parse-array surface)
(let* ((rest (cdr surface))
(let* ((rest (cdr (nest-array-type surface)))
(sized? (and (pair? rest) (integer? (last rest))))
(size (and sized? (last rest)))
(words (if sized? (drop-right rest 1) rest)))