File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 8585 (call-next-method )))))))
8686
8787(defgeneric context-interval (context1 context2 &optional result-type)
88- (:method ((context1 context) (context2 context) &optional (result-type ' string))
88+ (:method :before ((context1 context) (context2 context) &optional result-type)
89+ (declare (ignore result-type))
8990 (assert (eql (common-of context1)
9091 (common-of context2)))
9192 (assert (<= (position-of context1)
92- (position-of context2)))
93+ (position-of context2))))
94+ (:method ((context1 context) (context2 context) &optional (result-type ' string))
9395 (if (= (position-of context1) (position-of context2))
9496 (coerce nil result-type)
9597 (coerce (iter (for c initially context1 then (context-next c))
143145(defmethod context-peek ((context vector-context))
144146 (aref (storage-of context) (position-of context)))
145147
148+ (defmethod context-interval ((context1 vector-context) (context2 vector-context) &optional (result-type ' string))
149+ (let ((storage (storage-of context1)))
150+ (coerce (subseq storage (position-of context1) (position-of context2)) result-type)))
151+
152+ (defmethod context-interval ((context1 vector-context) (context2 end-context) &optional (result-type ' string))
153+ (let ((storage (storage-of context1)))
154+ (coerce (subseq storage (position-of context1)) result-type)))
155+
146156(defvar *default-context-cache* :vector )
147157
148158(defun make-cache (cache-type length )
You can’t perform that action at this time.
0 commit comments