aboutsummaryrefslogtreecommitdiff
path: root/module/c/cpp-environment.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/c/cpp-environment.scm')
-rw-r--r--module/c/cpp-environment.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/module/c/cpp-environment.scm b/module/c/cpp-environment.scm
index 2ad60b56..2a943496 100644
--- a/module/c/cpp-environment.scm
+++ b/module/c/cpp-environment.scm
@@ -19,7 +19,9 @@
enter-active-if
enter-inactive-if
+ flip-flop-if
leave-if
+ in-comment-block?
enter-file
leave-file
@@ -97,9 +99,19 @@
(define (enter-inactive-if environment)
(modify environment cpp-if-status xcons 'inactive-if))
+;; for #else
+(define (flip-flop-if environment)
+ ((if (in-comment-block? environment)
+ enter-active-if
+ enter-inactive-if)
+ (leave-if environment)))
+
(define (leave-if environment)
(modify environment cpp-if-status cdr))
+(define (in-comment-block? environment)
+ (eq? 'inactive-if (get environment cpp-if-status car*)))
+
(define (enter-file environment filename)