Update of /cvsroot/scsh/scsh/scsh/rx
In directory usw-pr-cvs1:/tmp/cvs-serv28775/scsh/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/scsh/rx/re.scm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** re.scm 1999/10/04 17:29:44 1.4
--- re.scm 2001/03/07 16:40:02 1.5
***************
*** 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.
|