From 792c82fc39a5013fbf9c25436b369e0519ae1d10 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Thu, 11 Apr 2013 14:08:37 +0400 Subject: [PATCH] Add print-object methods for some regex classes. --- optimize.lisp | 2 +- regex-class.lisp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/optimize.lisp b/optimize.lisp index 16b4b36..d538733 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -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)) diff --git a/regex-class.lisp b/regex-class.lisp index fb89c25..43c36e5 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -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