dump
This commit is contained in:
2
example/mini-test.sex
Normal file
2
example/mini-test.sex
Normal file
@@ -0,0 +1,2 @@
|
||||
(pub fn main () int
|
||||
(var l (* (struct list-int)) (make-list-int)))
|
||||
25
example/our-reader.sex
Normal file
25
example/our-reader.sex
Normal file
@@ -0,0 +1,25 @@
|
||||
(include stdio.h)
|
||||
|
||||
(defmacro (plus . rest)
|
||||
`(+ ,@rest))
|
||||
|
||||
(struct vertex
|
||||
((pos (struct ((x u32) (y u32))))
|
||||
(color (struct ((r float) (g float) (b float))))
|
||||
(mask u32)))
|
||||
|
||||
(enum
|
||||
(B A R))
|
||||
|
||||
;;; Main entry point
|
||||
;;; Multi line comments should be packed
|
||||
(pub fn main () int
|
||||
;; the vertex
|
||||
(var a (struct vertex) #(#(10 20)
|
||||
#(0.3 0.5 0.7)
|
||||
(c-bit-or B A R)))
|
||||
(printf "%d %f %d\n" ; the printf
|
||||
(plus a.pos.x a.pos.y)
|
||||
(plus a.color.r a.color.g a.color.b)
|
||||
a.mask)
|
||||
(return 0))
|
||||
6
example/structs.sex
Normal file
6
example/structs.sex
Normal file
@@ -0,0 +1,6 @@
|
||||
(struct settings
|
||||
((b-x u32)
|
||||
(l r t b x y w h u32)
|
||||
(color (struct
|
||||
((r g b a float))))
|
||||
(colors [struct color ((r g b a float))])))
|
||||
Reference in New Issue
Block a user