er-macro-transformer->expander
rsc-macro-transformer->expander
sc-macro-transformer->expander
+ spar-macro-transformer->expander
syntactic-keyword->item)
(export (runtime syntax)
classifier->runtime
keyword-item-impl
keyword-item?
rsc-macro-transformer->keyword-item
- sc-macro-transformer->keyword-item))
+ sc-macro-transformer->keyword-item
+ spar-macro-transformer->keyword-item))
(define-package (runtime syntax items)
(files "syntax-items")
(rsc-macro-transformer :rsc-macro-transformer)
(sc-macro-transformer :sc-macro-transformer)
(set! :set!)
+ (spar-macro-transformer :spar-macro-transformer)
(the-environment :the-environment))
(export (runtime mit-macros)
keyword:access
(expander-item (sc-wrapper transformer (runtime-getter env))
expr))
-(define (rsc-macro-transformer->expander transformer env #!optional expr)
- (expander-item (rsc-wrapper transformer (runtime-getter env))
- expr))
-
-(define (er-macro-transformer->expander transformer env #!optional expr)
- (expander-item (er-wrapper transformer (runtime-getter env))
- expr))
-
(define (sc-macro-transformer->keyword-item transformer closing-senv expr)
(expander-item (sc-wrapper transformer (lambda () closing-senv))
expr))
-(define (rsc-macro-transformer->keyword-item transformer closing-senv expr)
- (expander-item (rsc-wrapper transformer (lambda () closing-senv))
- expr))
-
-(define (er-macro-transformer->keyword-item transformer closing-senv expr)
- (expander-item (er-wrapper transformer (lambda () closing-senv))
- expr))
-
-(define (runtime-getter env)
- (lambda ()
- (runtime-environment->syntactic env)))
-
(define (sc-wrapper transformer get-closing-senv)
(lambda (form use-senv)
(close-syntax (transformer form use-senv)
(get-closing-senv))))
+(define (rsc-macro-transformer->expander transformer env #!optional expr)
+ (expander-item (rsc-wrapper transformer (runtime-getter env))
+ expr))
+
+(define (rsc-macro-transformer->keyword-item transformer closing-senv expr)
+ (expander-item (rsc-wrapper transformer (lambda () closing-senv))
+ expr))
+
(define (rsc-wrapper transformer get-closing-senv)
(lambda (form use-senv)
(close-syntax (transformer form (get-closing-senv))
use-senv)))
-(define (er-wrapper transformer get-closing-env)
+(define (er-macro-transformer->expander transformer env #!optional expr)
+ (expander-item (er-wrapper transformer (runtime-getter env))
+ expr))
+
+(define (er-macro-transformer->keyword-item transformer closing-senv expr)
+ (expander-item (er-wrapper transformer (lambda () closing-senv))
+ expr))
+
+(define (er-wrapper transformer get-closing-senv)
(lambda (form use-senv)
(close-syntax (transformer form
- (make-er-rename (get-closing-env))
+ (make-er-rename (get-closing-senv))
(make-er-compare use-senv))
use-senv)))
(define (make-er-compare use-senv)
(lambda (x y)
(identifier=? use-senv x use-senv y)))
+
+(define (spar-macro-transformer->expander spar env expr)
+ (keyword-item (spar-wrapper spar (runtime-getter env))
+ expr))
+
+(define (spar-macro-transformer->keyword-item spar closing-senv expr)
+ (keyword-item (spar-wrapper spar (lambda () closing-senv))
+ expr))
+
+(define (spar-wrapper spar get-closing-senv)
+ (lambda (form senv hist)
+ (reclassify (close-syntax ((spar->classifier spar) form senv hist)
+ (get-closing-senv))
+ senv
+ hist)))
+
+(define (runtime-getter env)
+ (lambda ()
+ (runtime-environment->syntactic env)))
\f
;;; Keyword items represent syntactic keywords.
;;; (failure)
(define (spar->classifier spar)
- (keyword-item
- (lambda (form senv hist)
- (spar (%new-input form hist)
- senv
- (%new-output)
- (lambda (input senv output failure)
- (declare (ignore senv failure))
- (if (%input-null? input)
- (error "Rule failed to match entire form."))
- (output 'get-only))
- (lambda ()
- (serror form senv hist "Ill-formed syntax:" form))))))
+ (lambda (form senv hist)
+ (spar (%new-input form hist)
+ senv
+ (%new-output)
+ (lambda (input senv output failure)
+ (declare (ignore senv failure))
+ (if (%input-null? input)
+ (error "Rule failed to match entire form."))
+ (output 'get-only))
+ (lambda ()
+ (serror form senv hist "Ill-formed syntax:" form)))))
\f
;;;; Inputs and outputs