mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
look up scheme translators by value, not by name
* module/language/scheme/translate.scm (custom-transformer-table): Rename from `primitive-syntax-table', because now it will handle procedural values as well. (lookup-transformer): Update for renaming. Look up custom transformers by value, not name. (make-pmatch-transformers): Key the transformer table by value, not name.
This commit is contained in:
parent
f03c31dbad
commit
7e97ad2dd6
1 changed files with 6 additions and 6 deletions
|
@ -58,10 +58,7 @@
|
|||
;; definition forward-declared them
|
||||
(and (variable-bound? var) (variable-ref var)))))))
|
||||
(cond
|
||||
((or (primitive-macro? val)
|
||||
(eq? val eval-case))
|
||||
(or (assq-ref primitive-syntax-table head)
|
||||
(syntax-error #f "unhandled primitive macro" head)))
|
||||
((assq-ref custom-transformer-table val))
|
||||
|
||||
((defmacro? val)
|
||||
(lambda (env loc exp)
|
||||
|
@ -77,6 +74,9 @@
|
|||
(with-fluids ((eec (module-eval-closure mod)))
|
||||
(sc-expand3 exp 'c '(compile load eval)))))))
|
||||
|
||||
((primitive-macro? val)
|
||||
(syntax-error #f "unhandled primitive macro" head))
|
||||
|
||||
((macro? val)
|
||||
(syntax-error #f "unknown kind of macro" head))
|
||||
|
||||
|
@ -121,7 +121,7 @@
|
|||
(define (make1 clause)
|
||||
(let ((sym (car clause))
|
||||
(clauses (cdr clause)))
|
||||
`(cons ',sym
|
||||
`(cons ,sym
|
||||
(lambda (,env ,loc ,exp)
|
||||
(define (,retranslate x) (trans ,env (location x) x))
|
||||
(pmatch (cdr ,exp)
|
||||
|
@ -131,7 +131,7 @@
|
|||
|
||||
(define *the-compile-toplevel-symbol* 'compile-toplevel)
|
||||
|
||||
(define primitive-syntax-table
|
||||
(define custom-transformer-table
|
||||
(make-pmatch-transformers
|
||||
e l retrans
|
||||
(quote
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue