summaryrefslogtreecommitdiffstats
path: root/mwsynrul.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
commitbd9733926076885e3417b74de76e4c9c7bc56254 (patch)
tree2c99dced547d48407ad44cb0e45e31bb4d02ce43 /mwsynrul.scm
parentfa3f23105ddcf07c5900de47f19af43d1db1b597 (diff)
downloadslib-bd9733926076885e3417b74de76e4c9c7bc56254.tar.gz
slib-bd9733926076885e3417b74de76e4c9c7bc56254.zip
Import Upstream version 2c7upstream/2c7
Diffstat (limited to 'mwsynrul.scm')
-rw-r--r--mwsynrul.scm20
1 files changed, 10 insertions, 10 deletions
diff --git a/mwsynrul.scm b/mwsynrul.scm
index 1784441..bc5d7de 100644
--- a/mwsynrul.scm
+++ b/mwsynrul.scm
@@ -136,7 +136,7 @@
(loop P '() 0 k))
(define (mw:compile-template T vars env)
-
+
(define (loop T inserted referenced rank escaped? k)
(cond ((symbol? T)
(let ((x (mw:pattern-variable T vars)))
@@ -185,7 +185,7 @@
(lambda (T inserted referenced)
(k (vector T) inserted referenced))))
(else (k T inserted referenced))))
-
+
(define (loop1 T inserted referenced rank escaped? k)
(loop (car T)
inserted
@@ -208,7 +208,7 @@
T2)
inserted
referenced))))))
-
+
(loop T
'()
'()
@@ -227,7 +227,7 @@
(list (mw:make-patternvar (string->symbol "") 0)))
(define (mw:match F P env-def env-use)
-
+
(define (match F P answer rank)
(cond ((null? P)
(and (null? F) answer))
@@ -248,7 +248,7 @@
(and (vector? F)
(match (vector->list F) (vector-ref P 0) answer rank)))
(else (and (equal? F P) answer))))
-
+
(define (match1 F P answer rank)
(cond ((not (list? F)) #f)
((null? F)
@@ -268,11 +268,11 @@
(mw:ellipsis-pattern-vars P))
answer)
#f)))))
-
+
(match F P mw:empty-pattern-variable-environment 0))
(define (mw:rewrite T alist)
-
+
(define (rewrite T alist rank)
(cond ((null? T) '())
((pair? T)
@@ -288,7 +288,7 @@
((vector? T)
(list->vector (rewrite (vector-ref T 0) alist rank)))
(else T)))
-
+
(define (rewrite1 T alist rank)
(let* ((T1 (mw:ellipsis-template T))
(vars (mw:ellipsis-template-vars T))
@@ -296,7 +296,7 @@
vars)))
(map (lambda (alist) (rewrite T1 alist rank))
(make-columns vars rows alist))))
-
+
(define (make-columns vars rows alist)
(define (loop rows)
(if (null? (car rows))
@@ -313,7 +313,7 @@
(mw:error "Use of macro is not consistent with definition"
vars
rows)))
-
+
(rewrite T alist 0))
; Given a use of a macro, the syntactic environment of the use,