designate an initializer's element by its index
[3] in braces reached the writer as a subscript of one operand, and sexc died taking the second.
This commit is contained in:
@@ -322,6 +322,7 @@
|
||||
((%sizeof-type) ((cat "sizeof(" (c-type (cadr x)) ")") st))
|
||||
((%compound) ((apply c-compound (cdr x)) st))
|
||||
((%designate) ((apply c-designate (cdr x)) st))
|
||||
((%designate-index) ((apply c-designate-index (cdr x)) st))
|
||||
((+ - & * / % ! ~ ^ && < > <= >= == != << >>
|
||||
= *= /= %= &= ^= >>= <<=) ; |\|| |\|\|| |\|=|
|
||||
((apply c-op x) st))
|
||||
@@ -927,6 +928,10 @@
|
||||
(define (c-designate field value)
|
||||
(cat "." (c-expr field) " = " (c-expr value)))
|
||||
|
||||
;; MODIFIED FROM UPSTREAM fmt-c, which designates fields only
|
||||
(define (c-designate-index index value)
|
||||
(cat "[" (c-expr index) "] = " (c-expr value)))
|
||||
|
||||
(define (c-typedef type alias . o)
|
||||
(c-wrap-stmt
|
||||
(cat "typedef " (c-type type alias) (fmt-join/prefix c-expr o " "))))
|
||||
|
||||
Reference in New Issue
Block a user