From 35b7888c9b5f217dd2911c0ba93519df36e97922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 11 Jul 2022 01:10:19 +0200 Subject: Rewrite handel-preprocessing-tokens. --- module/c/cpp-environment.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'module/c/cpp-environment.scm') 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) -- cgit v1.2.3