1
0
forked from alex-eg/sex

support cpp define

This commit is contained in:
2025-06-14 18:10:20 +03:00
parent e932afab0a
commit 075116dfd2
2 changed files with 6 additions and 3 deletions

View File

@@ -7,15 +7,17 @@
(chicken-load "list.seh") (chicken-load "list.seh")
(define (imports-test a b c) (chicken-define (imports-test a b c)
(fold + 0 (list 1 2 3 a b c))) (fold + 0 (list 1 2 3 a b c)))
(struct foo (struct foo
((float a) ((float a-field)
(int b) (int b)
((const char *) c) ((const char *) c)
((fn bool ((bool val))) not))) ((fn bool ((bool val))) not)))
(var foo f #((= .a-field 1.2)))
,(list-T '(int)) ,(list-T '(int))
,(make-list-T '(int) #f) ,(make-list-T '(int) #f)
,(add-value-list-T '(int) #f) ,(add-value-list-T '(int) #f)

View File

@@ -32,6 +32,7 @@
((prototype) '%prototype) ((prototype) '%prototype)
((var) '%var) ((var) '%var)
((begin) '%begin) ((begin) '%begin)
((define) '%define)
((pointer) '%pointer) ((pointer) '%pointer)
((array) '%array) ((array) '%array)
((@) 'vector-ref) ((@) 'vector-ref)
@@ -140,7 +141,7 @@
(define (process-form form acc) (define (process-form form acc)
(case (car form) (case (car form)
((chicken-define) (eval form) acc) ((chicken-define) (eval (cons 'define (cdr form))) acc)
((template) (eval form) acc) ((template) (eval form) acc)
((chicken-load) ((chicken-load)
(load (cadr form)) acc) (load (cadr form)) acc)