Signal error when trying to match against non-existent backref.

original commit: f8a9434cb6d1c3e82742b4090d35d6ebe1ef465d
This commit is contained in:
Dorai Sitaram 2005-04-25 14:22:38 +00:00
parent e41a34ee34
commit 4836b4c50e

View File

@ -448,7 +448,16 @@
(lambda (i1) (or (sk i1) (loup-or (cdr res))))
(lambda () (loup-or (cdr res)))))))
((:backref)
(let ((backref (cdr (pregexp-list-ref backrefs (cadr re)))))
(let* ((c (pregexp-list-ref backrefs (cadr re)))
(backref
(cond
(c => cdr)
(else
(error
'pregexp-match-positions-aux
'non-existent-backref
re)
#f))))
(if backref
(pregexp-string-match
(substring s (car backref) (cdr backref))
@ -664,4 +673,3 @@
)