diff --git a/lib/test-list.sex b/lib/test-list.sex index 1ef2f68..7a4c69c 100644 --- a/lib/test-list.sex +++ b/lib/test-list.sex @@ -7,7 +7,8 @@ (struct foo ((float a) - (int b))) + (int b) + ((const char *) c))) ,(list-T '(int)) ,(make-list-T '(int) #f) @@ -15,10 +16,14 @@ ,(length-list-T '(int) #f) ,(is-empty-list-T '(int) #f) -(fn bool bar () false) (extern fn void puk ((int a) (float b))) +(fn bool bar () false) +(pub fn void baz () true) + (extern var int i) +(var int j) +(pub var int k) (pub fn int main () (var (* list-int) l (make-list-int)) diff --git a/sexc.scm b/sexc.scm index 06c9122..417a992 100644 --- a/sexc.scm +++ b/sexc.scm @@ -102,11 +102,19 @@ acc)) (else (error "Extern what?")))) +(define (walk-public form acc) + (case (cadr form) + ((fn) + (walk-function form #f acc)) + ((var) + (append (walk-generic (list 'static (cdr form)) (list)) acc)) + (else (error "Pub what?")))) + (define (walk-sex-tree form acc) (case (car form) ((fn) (walk-function form #t acc)) ((extern) (walk-extern form acc)) - ((pub) (walk-function form #f acc)) + ((pub) (walk-public form acc)) ((struct union) (walk-struct form acc)) ((unquote) (fold (fn (walk-sex-tree x y)) acc