1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 16:30:19 +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:
Andy Wingo 2010-06-06 13:39:44 +02:00
parent 9846796b6a
commit f42d8bd8ff
4 changed files with 5259 additions and 5505 deletions

View file

@ -183,7 +183,7 @@
/* Major and minor versions must be single characters. */ /* Major and minor versions must be single characters. */
#define SCM_OBJCODE_MAJOR_VERSION 0 #define SCM_OBJCODE_MAJOR_VERSION 0
#define SCM_OBJCODE_MINOR_VERSION Q #define SCM_OBJCODE_MINOR_VERSION R
#define SCM_OBJCODE_MAJOR_VERSION_STRING \ #define SCM_OBJCODE_MAJOR_VERSION_STRING \
SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION) SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
#define SCM_OBJCODE_MINOR_VERSION_STRING \ #define SCM_OBJCODE_MINOR_VERSION_STRING \

View file

@ -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 /* 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 hey, there is code out there that calls this function, and expects to get
a procedure in return... */ a procedure in return... */
if (scm_is_pair (SCM_MACRO_BINDING (m)) if (scm_is_true (scm_procedure_p (SCM_MACRO_BINDING (m))))
&& scm_is_true (scm_procedure_p (scm_car (SCM_MACRO_BINDING (m))))) return SCM_MACRO_BINDING (m);
return scm_car (SCM_MACRO_BINDING (m));
else else
return SCM_BOOL_F; return SCM_BOOL_F;
} }

File diff suppressed because it is too large Load diff

View file

@ -980,17 +980,7 @@
(build-primref no-source 'make-syntax-transformer) (build-primref no-source 'make-syntax-transformer)
(list (build-data no-source name) (list (build-data no-source name)
(build-data no-source 'macro) (build-data no-source 'macro)
(build-application e)))))
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)
'()))))))))))
(define chi-when-list (define chi-when-list
(lambda (e when-list w) (lambda (e when-list w)
@ -1370,7 +1360,7 @@
(syntax-violation #f "encountered raw symbol in macro output" (syntax-violation #f "encountered raw symbol in macro output"
(source-wrap e w (wrap-subst w) mod) x)) (source-wrap e w (wrap-subst w) mod) x))
(else (decorate-source x s))))) (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)))) (new-mark))))
(define chi-body (define chi-body
@ -1532,7 +1522,7 @@
(lambda (expanded mod) (lambda (expanded mod)
(let ((p (local-eval-hook expanded mod))) (let ((p (local-eval-hook expanded mod)))
(if (procedure? p) (if (procedure? p)
(cons p (module-name (current-module))) p
(syntax-violation #f "nonprocedure transformer" p))))) (syntax-violation #f "nonprocedure transformer" p)))))
(define chi-void (define chi-void