Add print-object methods for some regex classes.

This commit is contained in:
Stas Boukarev
2013-04-11 14:08:37 +04:00
parent b7706d3a10
commit 792c82fc39
2 changed files with 13 additions and 1 deletions

View File

@ -367,7 +367,7 @@ zero-length assertion."))
ends with wrapped into a STR object, otherwise NIL.
OLD-CASE-INSENSITIVE-P is the CASE-INSENSITIVE-P slot of the last STR
collected or :VOID if no STR has been collected yet. (This is a helper
function called by END-STRIN.)"))
function called by END-STRING.)"))
(defmethod end-string-aux ((str str)
&optional (old-case-insensitive-p :void))

View File

@ -108,6 +108,10 @@ must appear after this repetition.")
register."))
(:documentation "REPETITION objects represent repetitions of regexes."))
(defmethod print-object ((repetition repetition) stream)
(print-unreadable-object (repetition stream :type t :identity t)
(princ (regex repetition) stream)))
(defclass register (regex)
((regex :initarg :regex
:accessor regex
@ -122,6 +126,10 @@ This is the index into *REGS-START* and *REGS-END*.")
:documentation "Name of this register or NIL."))
(:documentation "REGISTER objects represent register groups."))
(defmethod print-object ((register register) stream)
(print-unreadable-object (register stream :type t :identity t)
(princ (regex register) stream)))
(defclass standalone (regex)
((regex :initarg :regex
:accessor regex
@ -181,6 +189,10 @@ string because the SCAN function has done this already.")
STR which starts END-STRING (a slot of MATCHER)."))
(:documentation "STR objects represent string."))
(defmethod print-object ((str str) stream)
(print-unreadable-object (str stream :type t :identity t)
(princ (str str) stream)))
(defclass anchor (regex)
((startp :initarg :startp
:reader startp