From 92f61b75daf1f27b41093412e1ae7d4f9b65faed Mon Sep 17 00:00:00 2001 From: shivers Date: Fri, 1 Oct 1999 12:48:27 +0000 Subject: [PATCH] TRANSLATE-SEQ wasn't correctly accounting for submatches. The same bug occurred in a parallel position in TRANSLATE-CHOICE; when I fixed it there, I neglected to fix TRANSLATE-SEQ as well. -Olin --- scsh/rx/posixstr.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scsh/rx/posixstr.scm b/scsh/rx/posixstr.scm index a195ed7..bbd06e5 100644 --- a/scsh/rx/posixstr.scm +++ b/scsh/rx/posixstr.scm @@ -39,6 +39,11 @@ ;;; ;;; - paren count in the returned string. ;;; +;;; [This is a newer description; is it correct?] +;;; - A vector mapping submatches (vector index 0 is submatch 1) +;;; to the paren for that submatch (the first paren is paren #1). +;;; +;;; [This is my original description.] ;;; - Vector of parens numbers used for submatching. The first paren is ;;; numbered 1. #F means a dead submatch -- one we can tell statically ;;; will never match anything. @@ -199,7 +204,7 @@ (values (string-append s1 s) 2 (+ pcount1 pcount) - (vector-append (mapv (lambda (sm) (+ sm prev-smcount)) + (vector-append (mapv (lambda (p) (and p (+ p prev-pcount))) submatches1) submatches))))))