From 8f9ba977c3538816bb6f3e5edaee828b91cf5f3b Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 20 Oct 2013 17:31:05 +0900 Subject: [PATCH] Fixing name offsets. --- lib/chibi/regexp.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/chibi/regexp.scm b/lib/chibi/regexp.scm index c1df216e..cdeedf83 100644 --- a/lib/chibi/regexp.scm +++ b/lib/chibi/regexp.scm @@ -635,7 +635,8 @@ ((=> submatch-named) ;; Named submatches just record the name for the current ;; match and rewrite as a non-named submatch. - (set! match-names (cons (cons (cadr sre) current-match) match-names)) + (set! match-names + (cons (cons (cadr sre) (+ 1 current-match)) match-names)) (->rx (cons 'submatch (cddr sre)) flags next)) ((*=> submatch-named-list) (set! match-names (cons (cons (cadr sre) current-match) match-names))