From: Chris Hanson Date: Tue, 20 Nov 2001 04:07:08 +0000 (+0000) Subject: Top-level failure continuations must do backtracking. X-Git-Tag: 20090517-FFI~2431 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6a04daf5228fca5ad88c6a9519a5d205c77d0014;p=mit-scheme.git Top-level failure continuations must do backtracking. --- diff --git a/v7/src/star-parser/matcher.scm b/v7/src/star-parser/matcher.scm index 87f619a35..4dbbcd205 100644 --- a/v7/src/star-parser/matcher.scm +++ b/v7/src/star-parser/matcher.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: matcher.scm,v 1.24 2001/11/14 20:18:35 cph Exp $ +;;; $Id: matcher.scm,v 1.25 2001/11/20 04:07:05 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -191,10 +191,12 @@ (define (generate-matcher-code expression) (generate-external-procedure expression preprocess-matcher-expression (lambda (expression) - (bind-delayed-lambdas - (lambda (ks kf) (compile-matcher-expression expression #f ks kf)) - (make-matcher-ks-lambda (lambda (kf) kf `#T)) - (make-kf-lambda (lambda () `#F)))))) + (call-with-pointer #f + (lambda (p) + (bind-delayed-lambdas + (lambda (ks kf) (compile-matcher-expression expression #f ks kf)) + (make-matcher-ks-lambda (lambda (kf) kf `#T)) + (backtracking-kf p (lambda () `#F)))))))) (define (compile-matcher-expression expression pointer ks kf) (cond ((and (pair? expression) diff --git a/v7/src/star-parser/parser.scm b/v7/src/star-parser/parser.scm index 390d49b19..53d69c739 100644 --- a/v7/src/star-parser/parser.scm +++ b/v7/src/star-parser/parser.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: parser.scm,v 1.27 2001/11/14 20:19:13 cph Exp $ +;;; $Id: parser.scm,v 1.28 2001/11/20 04:07:08 cph Exp $ ;;; ;;; Copyright (c) 2001 Massachusetts Institute of Technology ;;; @@ -180,10 +180,12 @@ (define (generate-parser-code expression) (generate-external-procedure expression preprocess-parser-expression (lambda (expression) - (bind-delayed-lambdas - (lambda (ks kf) (compile-parser-expression expression #f ks kf)) - (make-parser-ks-lambda (lambda (v kf) kf v)) - (make-kf-lambda (lambda () #f)))))) + (call-with-pointer #f + (lambda (p) + (bind-delayed-lambdas + (lambda (ks kf) (compile-parser-expression expression #f ks kf)) + (make-parser-ks-lambda (lambda (v kf) kf v)) + (backtracking-kf p (lambda () #f)))))))) (define (compile-parser-expression expression pointer ks kf) (cond ((and (pair? expression)