From 5263ab1126adfc65e66104b50c618abea8c99772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 12 Jul 2022 02:46:12 +0200 Subject: s/macro?/cpp-macro?/g Guile cried way to much about me overriding a core identifier. --- module/c/cpp-environment.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/c/cpp-environment.scm') diff --git a/module/c/cpp-environment.scm b/module/c/cpp-environment.scm index c3bd79f1..76219edc 100644 --- a/module/c/cpp-environment.scm +++ b/module/c/cpp-environment.scm @@ -8,13 +8,14 @@ :use-module ((c cpp-environment function-like-macro) :prefix #{fun:}#) :use-module ((c cpp-environment object-like-macro) :prefix #{obj:}#) :use-module ((c cpp-environment internal-macro) :prefix #{int:}#) + :use-module ((c unlex) :select (unlex)) :export ( macro-identifier macro-body macro-identifier-list macro-variadic? - macro? + cpp-macro? ;; pprint-macro enter-active-if @@ -79,7 +80,7 @@ (define object-macro? obj:object-like-macro?) (define internal-macro? int:internal-macro?) -(define (macro? x) +(define (cpp-macro? x) (or (obj:object-like-macro? x) (fun:function-like-macro? x) (int:internal-macro? x))) @@ -158,7 +159,7 @@ (define (add-identifier environment key value) (typecheck key string?) - (typecheck value macro?) + (typecheck value cpp-macro?) (let ((environment (clone-environment environment))) (hash-set! (cpp-variables environment) key value) @@ -169,13 +170,13 @@ (define (extend-environment environment macros) - (typecheck macros (list-of macro?)) + (typecheck macros (list-of cpp-macro?)) (fold (lambda (m env) (add-identifier env (macro-identifier m) m)) environment macros)) (define (disjoin-macro environment name) (typecheck name string?) - (remove-identifier env name)) + (remove-identifier environment name)) @@ -199,7 +200,7 @@ (format p "#define ~a(~a) ~a" (macro-identifier x) (string-join (append (macro-identifier-list x) - (if (variadic? x) + (if (macro-variadic? x) '("...") '())) "," 'infix) (unlex (macro-body x)))))) -- cgit v1.2.3