mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Update verify-cps
* module/language/cps/verify.scm (verify-cps): Update for recent CPS changes.
This commit is contained in:
parent
6dc886faf1
commit
a2acec7c7f
1 changed files with 14 additions and 7 deletions
|
@ -113,14 +113,12 @@
|
||||||
(_
|
(_
|
||||||
(error "unexpected clause" clause))))
|
(error "unexpected clause" clause))))
|
||||||
|
|
||||||
(define (visit-fun fun k-env v-env)
|
(define (visit-entry entry k-env v-env)
|
||||||
(match fun
|
(match entry
|
||||||
(($ $fun (free ...)
|
(($ $cont kbody
|
||||||
($ $cont kbody
|
($ $kfun src meta self ($ $cont ktail ($ $ktail)) clause))
|
||||||
($ $kfun src meta self ($ $cont ktail ($ $ktail)) clause)))
|
|
||||||
(when (and meta (not (and (list? meta) (and-map pair? meta))))
|
(when (and meta (not (and (list? meta) (and-map pair? meta))))
|
||||||
(error "meta should be alist" meta))
|
(error "meta should be alist" meta))
|
||||||
(for-each (cut check-var <> v-env) free)
|
|
||||||
(check-src src)
|
(check-src src)
|
||||||
;; Reset the continuation environment, because Guile's
|
;; Reset the continuation environment, because Guile's
|
||||||
;; continuations are local.
|
;; continuations are local.
|
||||||
|
@ -128,6 +126,13 @@
|
||||||
(k-env (add-labels (list ktail) '())))
|
(k-env (add-labels (list ktail) '())))
|
||||||
(when clause
|
(when clause
|
||||||
(visit-clause clause k-env v-env))))
|
(visit-clause clause k-env v-env))))
|
||||||
|
(_ (error "unexpected $kfun" entry))))
|
||||||
|
|
||||||
|
(define (visit-fun fun k-env v-env)
|
||||||
|
(match fun
|
||||||
|
(($ $fun (free ...) entry)
|
||||||
|
(for-each (cut check-var <> v-env) free)
|
||||||
|
(visit-entry '() v-env))
|
||||||
(_
|
(_
|
||||||
(error "unexpected $fun" fun))))
|
(error "unexpected $fun" fun))))
|
||||||
|
|
||||||
|
@ -139,6 +144,8 @@
|
||||||
#t)
|
#t)
|
||||||
(($ $prim (? symbol? name))
|
(($ $prim (? symbol? name))
|
||||||
#t)
|
#t)
|
||||||
|
(($ $closure kfun n)
|
||||||
|
#t)
|
||||||
(($ $fun)
|
(($ $fun)
|
||||||
(visit-fun exp k-env v-env))
|
(visit-fun exp k-env v-env))
|
||||||
(($ $call proc (arg ...))
|
(($ $call proc (arg ...))
|
||||||
|
@ -184,5 +191,5 @@
|
||||||
(_
|
(_
|
||||||
(error "unexpected term" term))))
|
(error "unexpected term" term))))
|
||||||
|
|
||||||
(visit-fun fun '() '())
|
(visit-entry fun '() '())
|
||||||
fun)
|
fun)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue