Skip to content

Commit

Permalink
Get rid of unused INSIDE-SUBPATTERN-REFERENCE variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbtrap committed Jan 8, 2014
1 parent b05a808 commit c70985f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
17 changes: 6 additions & 11 deletions closures.lisp
Expand Up @@ -86,8 +86,7 @@ such that the call to NEXT-FN after the match would succeed."))

(defmethod create-matcher-aux ((register register) next-fn)
(declare #.*standard-optimize-settings*)
(declare (special referenced-register-matchers
inside-subpattern-reference))
(declare (special referenced-register-matchers))
;; the position of this REGISTER within the whole regex; we start to
;; count at 0
(let ((num (num register)))
Expand Down Expand Up @@ -121,19 +120,15 @@ such that the call to NEXT-FN after the match would succeed."))
(cond
(other-fn
;; The presence of OTHER-FN indicates we have been called by a
;; subpattern reference closure. Bind INSIDE-SUBPATTERN-REFERENCE
;; and call the matcher for this register's regex.
;; subpattern reference closure.
(let ((next-pos
(let* ((inside-subpattern-reference t)
;; Create a new temporary set of registers for
;; matching back references while inside a
;; subpattern reference, as with Perl. Cf. tests
;; 1643-1646.
(reg-num (array-dimension *reg-starts* 0))
;; Create a new temporary set of registers for matching
;; back references while inside a subpattern reference, as
;; with Perl. Cf. tests 1643-1646.
(let* ((reg-num (array-dimension *reg-starts* 0))
(*reg-starts* (make-array reg-num :initial-element nil))
(*regs-maybe-start* (make-array reg-num :initial-element nil))
(*reg-ends* (make-array reg-num :initial-element nil)))
(declare (special inside-subpattern-reference))
(setf (svref *regs-maybe-start* num) start-pos)
(funcall inner-matcher-without-next-fn start-pos))))
(when next-pos
Expand Down
7 changes: 2 additions & 5 deletions scanner.lisp
Expand Up @@ -157,11 +157,8 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX."
(str starts-with)
nil))
;; we don't need to try further than MAX-END-POS
(max-end-pos (- *end-pos* min-len))
inside-subpattern-reference)
(declare (fixnum scan-start-pos)
(special inside-subpattern-reference)
(function match-fn))
(max-end-pos (- *end-pos* min-len)))
(declare (fixnum scan-start-pos) (function match-fn))
;; definition of ADVANCE-FN will be inserted here by macrology
(labels ((advance-fn-definition))
(declare (inline advance-fn))
Expand Down

0 comments on commit c70985f

Please sign in to comment.