From: Chris Hanson Date: Sun, 7 Jan 2007 06:48:52 +0000 (+0000) Subject: Elide nested groups. X-Git-Tag: 20090517-FFI~814 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=737cb8318be578d1d591610a5a5c86b6d44e1a60;p=mit-scheme.git Elide nested groups. --- diff --git a/v7/src/runtime/rexp.scm b/v7/src/runtime/rexp.scm index 31b140116..0e7d173d4 100644 --- a/v7/src/runtime/rexp.scm +++ b/v7/src/runtime/rexp.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: rexp.scm,v 1.26 2007/01/05 21:19:28 cph Exp $ +$Id: rexp.scm,v 1.27 2007/01/07 06:48:52 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -106,7 +106,10 @@ USA. rexps)) (define (rexp-group . rexps) - `(GROUP ,(apply rexp-sequence rexps))) + (let ((rexp (apply rexp-sequence rexps))) + (if (and (pair? rexp) (eq? (car rexp) 'GROUP)) + rexp + `(GROUP ,rexp)))) (define (rexp-optional . rexps) `(OPTIONAL ,(rexp-groupify (apply rexp-sequence rexps))))