diff options
| author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2025-12-31 16:14:31 -0300 |
|---|---|---|
| committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2025-12-31 16:14:31 -0300 |
| commit | 9566e92321a1ed29a7f5903a3ba4ab16de3783b9 (patch) | |
| tree | db2360d29cc3e8fe931b868017c662fc6aabbc5f /cursor.lisp | |
| parent | 13525655b8a8577b0f1f467515ec259e85028b10 (diff) | |
| download | monparser-9566e92321a1ed29a7f5903a3ba4ab16de3783b9.tar.gz monparser-9566e92321a1ed29a7f5903a3ba4ab16de3783b9.zip | |
Type check functions
Diffstat (limited to 'cursor.lisp')
| -rw-r--r-- | cursor.lisp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cursor.lisp b/cursor.lisp index 321ec3b..72d4c90 100644 --- a/cursor.lisp +++ b/cursor.lisp @@ -1,6 +1,6 @@ (in-package #:monparser) -(defclass text () +(defclass cursor () ((index :type (unsigned-byte 44) :initarg :index :accessor index :initform 0) (data :type simple-string :initarg :data :reader data :initform ""))) @@ -12,7 +12,7 @@ (index cursor))) (defun advance (cursor) - (make-instance 'text + (make-instance 'cursor :data (data cursor) :index (+ (index cursor) 1))) @@ -29,7 +29,7 @@ (push (subseq str begin index) result) result)) -(defmethod print-object ((obj text) stream) +(defmethod print-object ((obj cursor) stream) (print-unreadable-object (obj stream :type t) (let ((str (if (has-data? obj) (format nil "~{~a[4;33m~a[m~a~}" |
