forked from alex-eg/sex
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:
@@ -353,9 +353,10 @@ forms, and what remains."
|
||||
;; (const * const * const char) -> (const char * const * const)
|
||||
;; (fn ((int) (float)) void) -> (%fun void ((int) (float)))
|
||||
(match form
|
||||
(('¤ . array-type)
|
||||
(('¤ . _)
|
||||
(if (array-bound? form)
|
||||
`(%array ,(walk-type (array-element-type form)) ,(walk-expr (last array-type)))
|
||||
`(%array ,(walk-type (array-element-type form))
|
||||
,(walk-expr (array-bound form)))
|
||||
;; sugar for pointer... Do we really need it? Guess why not,
|
||||
;; it's a strong semantic cue
|
||||
`(%array ,(walk-type (array-element-type form)))))
|
||||
|
||||
Reference in New Issue
Block a user