aboutsummaryrefslogtreecommitdiff
path: root/module/c/cpp-environment.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-07-13 12:46:45 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-07-13 12:46:45 +0200
commitc1defcf83c0eedd2fc5cf70c43239336d5abf238 (patch)
treeae6678bec98c057f855a44ed16fc3b3e650f3ff9 /module/c/cpp-environment.scm
parentResolve #ifdef, #ifndef, #else, #endif. (diff)
downloadcalp-c1defcf83c0eedd2fc5cf70c43239336d5abf238.tar.gz
calp-c1defcf83c0eedd2fc5cf70c43239336d5abf238.tar.xz
Clearen conditional status predicates.
Diffstat (limited to 'module/c/cpp-environment.scm')
-rw-r--r--module/c/cpp-environment.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/module/c/cpp-environment.scm b/module/c/cpp-environment.scm
index 76219edc..a6401e71 100644
--- a/module/c/cpp-environment.scm
+++ b/module/c/cpp-environment.scm
@@ -22,7 +22,9 @@
enter-inactive-if
flip-flop-if
leave-if
- in-comment-block?
+ in-conditional/active?
+ in-conditional/inactive?
+ in-conditional?
enter-file
leave-file
@@ -110,7 +112,7 @@
;; for #else
(define (flip-flop-if environment)
- ((if (in-comment-block? environment)
+ ((if (in-conditional/inactive? environment)
enter-active-if
enter-inactive-if)
(leave-if environment)))
@@ -118,9 +120,16 @@
(define (leave-if environment)
(modify environment cpp-if-status cdr))
-(define (in-comment-block? environment)
+(define (in-conditional/inactive? environment)
(eq? 'inactive-if (get environment cpp-if-status car*)))
+(define (in-conditional/active? environment)
+ (eq? 'active-if (get environment cpp-if-status car*)))
+
+(define (in-conditional? environment)
+ (or (in-conditional/inactive? environment)
+ (in-conditional/active? environment)))
+
(define (enter-file environment filename)