From: Chris Hanson Date: Thu, 13 Apr 2000 19:47:34 +0000 (+0000) Subject: Fix infinite recursion. X-Git-Tag: 20090517-FFI~4027 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fa883e81a7f2713e0aa03f76fd3118295a6adc21;p=mit-scheme.git Fix infinite recursion. --- diff --git a/v7/src/imail/rexp.scm b/v7/src/imail/rexp.scm index a54a4f255..0035ff73f 100644 --- a/v7/src/imail/rexp.scm +++ b/v7/src/imail/rexp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: rexp.scm,v 1.9 2000/04/13 17:57:57 cph Exp $ +;;; $Id: rexp.scm,v 1.10 2000/04/13 19:47:34 cph Exp $ ;;; ;;; Copyright (c) 2000 Massachusetts Institute of Technology ;;; @@ -86,7 +86,7 @@ ((and (pair? rexp) (eq? 'SEQUENCE (car rexp))) (cdr rexp)) ((and (pair? rexp) (eq? 'ALTERNATIVES (car rexp))) - (list (rexp-group rexp))) + (list `(GROUP ,rexp))) (else (list rexp)))) rexps)) @@ -104,17 +104,18 @@ `(+ ,(rexp-groupify (apply rexp-sequence rexps)))) (define (rexp-groupify rexp) - (let ((no-group (lambda () (error "Expression can't be grouped:" rexp)))) + (let ((group (lambda () `(GROUP ,rexp))) + (no-group (lambda () (error "Expression can't be grouped:" rexp)))) (cond ((string? rexp) (case (string-length rexp) ((0) (no-group)) ((1) rexp) - (else (rexp-group rexp)))) + (else (group)))) ((pair? rexp) (cond ((memq (car rexp) boundary-rexp-types) (no-group)) ((memq (car rexp) '(ALTERNATIVES SEQUENCE OPTIONAL * +)) - (rexp-group rexp)) + (group)) (else rexp))) (else rexp)))) diff --git a/v7/src/runtime/rexp.scm b/v7/src/runtime/rexp.scm index a54a4f255..0035ff73f 100644 --- a/v7/src/runtime/rexp.scm +++ b/v7/src/runtime/rexp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: rexp.scm,v 1.9 2000/04/13 17:57:57 cph Exp $ +;;; $Id: rexp.scm,v 1.10 2000/04/13 19:47:34 cph Exp $ ;;; ;;; Copyright (c) 2000 Massachusetts Institute of Technology ;;; @@ -86,7 +86,7 @@ ((and (pair? rexp) (eq? 'SEQUENCE (car rexp))) (cdr rexp)) ((and (pair? rexp) (eq? 'ALTERNATIVES (car rexp))) - (list (rexp-group rexp))) + (list `(GROUP ,rexp))) (else (list rexp)))) rexps)) @@ -104,17 +104,18 @@ `(+ ,(rexp-groupify (apply rexp-sequence rexps)))) (define (rexp-groupify rexp) - (let ((no-group (lambda () (error "Expression can't be grouped:" rexp)))) + (let ((group (lambda () `(GROUP ,rexp))) + (no-group (lambda () (error "Expression can't be grouped:" rexp)))) (cond ((string? rexp) (case (string-length rexp) ((0) (no-group)) ((1) rexp) - (else (rexp-group rexp)))) + (else (group)))) ((pair? rexp) (cond ((memq (car rexp) boundary-rexp-types) (no-group)) ((memq (car rexp) '(ALTERNATIVES SEQUENCE OPTIONAL * +)) - (rexp-group rexp)) + (group)) (else rexp))) (else rexp))))