From 9566e92321a1ed29a7f5903a3ba4ab16de3783b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 31 Dec 2025 16:14:31 -0300 Subject: Type check functions --- cursor.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cursor.lisp') 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~a~a~}" -- cgit v1.2.3