use true bool, since we target c99 onwards
This commit is contained in:
@@ -120,10 +120,6 @@ forms, and what remains."
|
|||||||
((|\||) 'bit-or)
|
((|\||) 'bit-or)
|
||||||
((|\|\||) '%or)
|
((|\|\||) '%or)
|
||||||
((|\|=|) 'bit-or=)
|
((|\|=|) 'bit-or=)
|
||||||
;; uh things we do for c89 compatibility
|
|
||||||
((bool) 'int)
|
|
||||||
((true) 1)
|
|
||||||
((false) 0)
|
|
||||||
(else
|
(else
|
||||||
(if (symbol? atom)
|
(if (symbol? atom)
|
||||||
(unkebabify atom)
|
(unkebabify atom)
|
||||||
|
|||||||
1
sexc.scm
1
sexc.scm
@@ -176,6 +176,7 @@ status, which is ours to pass on."
|
|||||||
|
|
||||||
(define prelude
|
(define prelude
|
||||||
'((include inttypes.h)
|
'((include inttypes.h)
|
||||||
|
(include stdbool.h)
|
||||||
|
|
||||||
(typedef u8 uint8-t)
|
(typedef u8 uint8-t)
|
||||||
(typedef i8 int8-t)
|
(typedef i8 int8-t)
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
(test 'vector-ref (atom-to-fmt-c '¤))
|
(test 'vector-ref (atom-to-fmt-c '¤))
|
||||||
(test '%include (atom-to-fmt-c 'include))
|
(test '%include (atom-to-fmt-c 'include))
|
||||||
|
|
||||||
;; c89 stuff
|
;; C99 onwards, true C spellings for bool
|
||||||
(test 'int (atom-to-fmt-c 'bool))
|
(test 'bool (atom-to-fmt-c 'bool))
|
||||||
(test 1 (atom-to-fmt-c 'true))
|
(test 'true (atom-to-fmt-c 'true))
|
||||||
(test 0 (atom-to-fmt-c 'false))
|
(test 'false (atom-to-fmt-c 'false))
|
||||||
|
|
||||||
;; dot-access -> %. member-access directive (kebab-converted operands)
|
;; dot-access -> %. member-access directive (kebab-converted operands)
|
||||||
(test '(%. a b) (walk-expr '(dot-access a b)))
|
(test '(%. a b) (walk-expr '(dot-access a b)))
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
(test
|
(test
|
||||||
'(struct mega_kebab ((int a)
|
'(struct mega_kebab ((int a)
|
||||||
((struct ((int year) (int month) (int day))) dob)
|
((struct ((int year) (int month) (int day))) dob)
|
||||||
((%fun int ((int) (%array int))) min)))
|
((%fun bool ((int) (%array int))) min)))
|
||||||
(walk-struct '(struct mega-kebab
|
(walk-struct '(struct mega-kebab
|
||||||
((a int)
|
((a int)
|
||||||
(dob (struct ((year int)
|
(dob (struct ((year int)
|
||||||
|
|||||||
Reference in New Issue
Block a user