forked from alex-eg/sex
let sizeof take a type that looks like an expression
(* char) is a pointer type and (* p) a dereference, and only the names in scope tell them apart, so semen decides and marks a type for the writer. Before, both were walked as expressions: sizeof(*char). Fixes #52.
This commit is contained in:
@@ -288,6 +288,7 @@
|
||||
((%comment) ((apply c-comment (cdr x)) st))
|
||||
((:) ((apply c-label (cdr x)) st))
|
||||
((%cast) ((apply c-cast (cdr x)) st))
|
||||
((%sizeof-type) ((cat "sizeof(" (c-type (cadr x)) ")") st))
|
||||
((%compound) ((apply c-compound (cdr x)) st))
|
||||
((%designate) ((apply c-designate (cdr x)) st))
|
||||
((+ - & * / % ! ~ ^ && < > <= >= == != << >>
|
||||
|
||||
Reference in New Issue
Block a user