mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 07:50:20 +02:00
simplify macro representation in the wake of module hygiene changes
* module/ice-9/psyntax.scm (chi-install-global, chi-macro) (eval-local-transformer): Now that we handle module hygiene through syntax objects, there is no more need to record the current module when installing syntax transformers. * module/ice-9/psyntax-pp.scm: Regenerated (trickily). * libguile/_scm.h: Bump objcode version for macro representation change. * libguile/macros.c (scm_macro_transformer): Adapt to change in macro representation.
This commit is contained in:
parent
9846796b6a
commit
f42d8bd8ff
4 changed files with 5259 additions and 5505 deletions
|
@ -183,7 +183,7 @@
|
|||
|
||||
/* Major and minor versions must be single characters. */
|
||||
#define SCM_OBJCODE_MAJOR_VERSION 0
|
||||
#define SCM_OBJCODE_MINOR_VERSION Q
|
||||
#define SCM_OBJCODE_MINOR_VERSION R
|
||||
#define SCM_OBJCODE_MAJOR_VERSION_STRING \
|
||||
SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
|
||||
#define SCM_OBJCODE_MINOR_VERSION_STRING \
|
||||
|
|
|
@ -157,9 +157,8 @@ SCM_DEFINE (scm_macro_transformer, "macro-transformer", 1, 0, 0,
|
|||
/* here we rely on knowledge of how psyntax represents macro bindings, but
|
||||
hey, there is code out there that calls this function, and expects to get
|
||||
a procedure in return... */
|
||||
if (scm_is_pair (SCM_MACRO_BINDING (m))
|
||||
&& scm_is_true (scm_procedure_p (scm_car (SCM_MACRO_BINDING (m)))))
|
||||
return scm_car (SCM_MACRO_BINDING (m));
|
||||
if (scm_is_true (scm_procedure_p (SCM_MACRO_BINDING (m))))
|
||||
return SCM_MACRO_BINDING (m);
|
||||
else
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -980,17 +980,7 @@
|
|||
(build-primref no-source 'make-syntax-transformer)
|
||||
(list (build-data no-source name)
|
||||
(build-data no-source 'macro)
|
||||
(build-application
|
||||
no-source
|
||||
(build-primref no-source 'cons)
|
||||
(list e
|
||||
(build-application
|
||||
no-source
|
||||
(build-primref no-source 'module-name)
|
||||
(list (build-application
|
||||
no-source
|
||||
(build-primref no-source 'current-module)
|
||||
'()))))))))))
|
||||
e)))))
|
||||
|
||||
(define chi-when-list
|
||||
(lambda (e when-list w)
|
||||
|
@ -1370,7 +1360,7 @@
|
|||
(syntax-violation #f "encountered raw symbol in macro output"
|
||||
(source-wrap e w (wrap-subst w) mod) x))
|
||||
(else (decorate-source x s)))))
|
||||
(rebuild-macro-output ((car p) (source-wrap e (anti-mark w) s mod))
|
||||
(rebuild-macro-output (p (source-wrap e (anti-mark w) s mod))
|
||||
(new-mark))))
|
||||
|
||||
(define chi-body
|
||||
|
@ -1532,7 +1522,7 @@
|
|||
(lambda (expanded mod)
|
||||
(let ((p (local-eval-hook expanded mod)))
|
||||
(if (procedure? p)
|
||||
(cons p (module-name (current-module)))
|
||||
p
|
||||
(syntax-violation #f "nonprocedure transformer" p)))))
|
||||
|
||||
(define chi-void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue