diff --git a/module/nyacc/lalr.scm b/module/nyacc/lalr.scm index 4cd57ed2..e29a4bc1 100644 --- a/module/nyacc/lalr.scm +++ b/module/nyacc/lalr.scm @@ -16,6 +16,13 @@ ;;; License along with this library; if not, write to the Free Software ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +(cond-expand + (guile-2) + (guile + (use-modules (ice-9 syncase)) + (use-modules (ice-9 optargs))) + (mes)) + ;; I need to find way to preserve srconf, rrconf after hashify. ;; compact needs to deal with it ... @@ -38,8 +45,6 @@ process-spec reserved? ) - #:use-module (ice-9 optargs) - #:use-module (ice-9 syncase) #:use-module ((srfi srfi-1) #:select (fold fold-right remove lset-union lset-intersection lset-difference)) #:use-module ((srfi srfi-9) #:select (define-record-type)) diff --git a/module/nyacc/lang/c99/cpp.scm b/module/nyacc/lang/c99/cpp.scm index f232e902..fda8ecf2 100644 --- a/module/nyacc/lang/c99/cpp.scm +++ b/module/nyacc/lang/c99/cpp.scm @@ -25,13 +25,18 @@ cpp-expand-text expand-cpp-mref ) - #:use-module (ice-9 syncase) #:use-module (nyacc parse) #:use-module (nyacc lex) #:use-module (nyacc lang util) #:use-module (rnrs arithmetic bitwise) ) +(cond-expand + (guile-2) + (guile + (use-modules (ice-9 syncase))) + (mes)) + #| #define #undef #include #if #ifdef #ifndef #else #endif #elif #line defined #-operator ##-operator #pragma #error diff --git a/module/nyacc/lang/c99/parser.scm b/module/nyacc/lang/c99/parser.scm index 10643094..ad2fbcac 100644 --- a/module/nyacc/lang/c99/parser.scm +++ b/module/nyacc/lang/c99/parser.scm @@ -19,8 +19,6 @@ (define-module (nyacc lang c99 parser) #:export (parse-c parse-c99 def-xdef? std-dict) - #:use-module (ice-9 optargs) - #:use-module (ice-9 syncase) #:use-module (nyacc lex) #:use-module (nyacc parse) #:use-module (nyacc lang util) @@ -29,6 +27,13 @@ #:use-module ((sxml xpath) #:select (sxpath)) ) +(cond-expand + (guile-2) + (guile + (use-modules (ice-9 syncase)) + (use-modules (ice-9 optargs))) + (mes)) + (include-from-path "nyacc/lang/c99/mach.d/c99tab.scm") (include-from-path "nyacc/lang/c99/body.scm") (include-from-path "nyacc/lang/c99/mach.d/c99act.scm") diff --git a/module/nyacc/lang/util.scm b/module/nyacc/lang/util.scm index d30e1758..5d3f719e 100644 --- a/module/nyacc/lang/util.scm +++ b/module/nyacc/lang/util.scm @@ -21,10 +21,16 @@ ;; for ??? move-if-changed fmterr) - #:use-module (ice-9 optargs) #:use-module ((srfi srfi-1) #:select(find)) ) +(cond-expand + (guile-2) + (guile + (use-modules (ice-9 optargs)) + (use-modules (ice-9 syncase))) + (mes)) + ;; This is a generic copyright/licence that will be printed in the output ;; of the examples/nyacc/lang/*/ actions.scm and tables.scm files. (define lang-crn-lic "Copyright (C) 2015,2016 Matthew R. Wette diff --git a/module/nyacc/lex.scm b/module/nyacc/lex.scm index 4728b487..cd9430ad 100644 --- a/module/nyacc/lex.scm +++ b/module/nyacc/lex.scm @@ -49,12 +49,17 @@ like-c-ident? filter-mt remove-mt map-mt make-ident-like-p c:ws c:if c:ir) - #:use-module (ice-9 optargs) - #:use-module (ice-9 syncase) #:use-module ((srfi srfi-1) #:select (remove append-reverse)) #:use-module (ice-9 pretty-print) ) +(cond-expand + (guile-2) + (guile + (use-modules (ice-9 syncase)) + (use-modules (ice-9 optargs))) + (mes)) + ;; @section Constructing Lexical Analyzers ;; The @code{lex} module provides a set of procedures to build lexical ;; analyzers. The approach is to first build a set of @defn{readers} for