aboutsummaryrefslogtreecommitdiff
path: root/module/c/preprocessor2.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/c/preprocessor2.scm')
-rw-r--r--module/c/preprocessor2.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/module/c/preprocessor2.scm b/module/c/preprocessor2.scm
index 2677c42e..28d11901 100644
--- a/module/c/preprocessor2.scm
+++ b/module/c/preprocessor2.scm
@@ -633,12 +633,18 @@
((if) resolve-for-if)
((ifdef)
(lambda (env body)
- (if (in-environment? env (identifier-token? (car body)))
- enter-active-if enter-inactive-if)))
+ ((if (in-environment? env (identifier-token? (car body)))
+ enter-active-if enter-inactive-if)
+ env)))
((ifndef)
(lambda (env body)
- (if (in-environment? env (identifier-token? (car body)))
- enter-inactive-if enter-active-if)))
+ ((if (in-environment? env (identifier-token? (car body)))
+ enter-inactive-if enter-active-if)
+ env)))
+ ;; NOTE possibly validate that body is empty for endif and else
+ ((endif) (lambda (env _) (leave-if env)))
+ ((else) (lambda (env _) (flip-flop-if env)))
+ ;; ((elif) (lambda ))
((define) resolve-define)
((undef) (lambda (env body) (remove-identifier env (identifier-token? (car body)))))
((line) handle-line-directive)