Skip to content

Commit

Permalink
Rename SUBREGISTER-COUNT -> INNER-REGISTER-COUNT.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbtrap committed Mar 1, 2014
1 parent a833ffb commit bef1a6a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions closures.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ such that the call to NEXT-FN after the match would succeed."))
(declare #.*standard-optimize-settings*)
(declare (special register-matchers))
(let ((num (num register))
(subregister-count (subregister-count register))
(inner-register-count (inner-register-count register))
;; a place to store the next function to call when we arrive
;; here via a subpattern reference
subpattern-ref-continuations)
(declare (fixnum num subregister-count)
(declare (fixnum num inner-register-count)
(list subpattern-ref-continuations))
(labels
((push-registers-state (new-starts new-maybe-starts new-ends)
(declare (list new-starts new-maybe-starts new-ends))
;; only push the register states for this register and registers
;; local to it
(loop for idx from num upto (+ num subregister-count) do
(loop for idx from num upto (+ num inner-register-count) do
(locally (declare (fixnum idx))
(push (svref *reg-ends* idx) (svref *reg-ends-stacks* idx))
(setf (svref *reg-ends* idx) (pop new-ends))
Expand All @@ -111,7 +111,7 @@ such that the call to NEXT-FN after the match would succeed."))
;; return the state that was destroyed by this restore
(let (old-starts old-maybe-starts old-ends)
(declare (list old-starts old-maybe-starts old-ends))
(loop for idx from (+ num subregister-count) downto num do
(loop for idx from (+ num inner-register-count) downto num do
(locally (declare (fixnum idx))
(push (svref *reg-ends* idx) old-ends)
(setf (svref *reg-ends* idx) (pop (svref *reg-ends-stacks* idx)))
Expand Down
2 changes: 1 addition & 1 deletion convert.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ when NAME is not NIL."
:regex (convert-aux (if name (third parse-tree) (second parse-tree)))
:num stored-reg-num
:name name
:subregister-count (- (the fixnum reg-num) stored-reg-num 1))))
:inner-register-count (- (the fixnum reg-num) stored-reg-num 1))))

(defmethod convert-compound-parse-tree ((token (eql :named-register)) parse-tree &key)
"The case for \(:NAMED-REGISTER <regex>)."
Expand Down
2 changes: 1 addition & 1 deletion regex-class-util.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ which are not of type STR."))
:regex (copy-regex (regex register))
:num (num register)
:name (name register)
:subregister-count (subregister-count register)))
:inner-register-count (inner-register-count register)))

(defmethod copy-regex ((standalone standalone))
(declare #.*standard-optimize-settings*)
Expand Down
8 changes: 4 additions & 4 deletions regex-class.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ This is the index into *REGS-START* and *REGS-END*.")
(name :initarg :name
:reader name
:documentation "Name of this register or NIL.")
(subregister-count :initarg :subregister-count
:reader subregister-count
:type fixnum
:documentation "The number of registers nested within this register."))
(inner-register-count :initarg :inner-register-count
:reader inner-register-count
:type fixnum
:documentation "The number of registers nested within this register."))
(:documentation "REGISTER objects represent register groups."))

(defmethod print-object ((register register) stream)
Expand Down

0 comments on commit bef1a6a

Please sign in to comment.