scsh-checkins
[Top] [All Lists]

[Scsh-checkins] CVS: scsh-0.6/scsh/rx re.scm,1.2,1.3

To: scsh-checkins@lists.sourceforge.net
Subject: [Scsh-checkins] CVS: scsh-0.6/scsh/rx re.scm,1.2,1.3
From: Olin Shivers <olin-shivers@users.sourceforge.net>
Date: Wed, 07 Mar 2001 08:46:11 -0800
List-id: <scsh-checkins.lists.sourceforge.net>
Sender: scsh-checkins-admin@lists.sourceforge.net
Update of /cvsroot/scsh/scsh-0.6/scsh/rx
In directory usw-pr-cvs1:/tmp/cvs-serv31147/rx

Modified Files:
        re.scm 
Log Message:
Fixed a bug in re-dsm. It pushed a pre-dsm value inside a submatch record --
but the submatch pre-dsm field describes deleted submatches occuring *after*
the indicated submatch and *before* the submatch's body. So this
"simplification" was swapping the order of these deleted submatches with
the live submatch, throwing off the ordering.
    -Olin



Index: re.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/rx/re.scm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** re.scm      1999/10/05 18:46:00     1.2
--- re.scm      2001/03/07 16:46:09     1.3
***************
*** 42,46 ****
  
  ;;; Slightly smart DSM constructor:
! ;;; - Absorb this DSM into an inner dsm, or submatch.
  ;;; - Punt unnecessary DSM's.
  
--- 42,46 ----
  
  ;;; Slightly smart DSM constructor:
! ;;; - Absorb this DSM into an inner dsm.
  ;;; - Punt unnecessary DSM's.
  
***************
*** 50,61 ****
        (let ((pre-dsm (+ pre-dsm pre-dsm1)))
  
!       (? ((= tsm (re-tsm body1)) body1)               ; Trivial DSM
! 
!          ((re-submatch? body1)                        ; Absorb into submatch.
!           (%make-re-submatch (re-submatch:body body1)
!                              (+ pre-dsm (re-submatch:pre-dsm body1))
!                              tsm))
! 
!          (else (%make-re-dsm body1 pre-dsm tsm))))))) ; Non-trivial DSM
  
  ;;; Take a regexp RE and return an equivalent (re', pre-dsm) pair of values.
--- 50,55 ----
        (let ((pre-dsm (+ pre-dsm pre-dsm1)))
  
!       (if (= tsm (re-tsm body1)) body1                ; Trivial DSM
!           (%make-re-dsm body1 pre-dsm tsm))))))       ; Non-trivial DSM
  
  ;;; Take a regexp RE and return an equivalent (re', pre-dsm) pair of values.



<Prev in Thread] Current Thread [Next in Thread>
  • [Scsh-checkins] CVS: scsh-0.6/scsh/rx re.scm,1.2,1.3, Olin Shivers <=