From: Mark Wooding Date: Sun, 30 Aug 2015 09:58:38 +0000 (+0100) Subject: src/module-impl.lisp: Expose `c-fragment' state. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/88b38efdc57dffee6f83ea881a1740531b97754c src/module-impl.lisp: Expose `c-fragment' state. * Export `c-fragment-text', and use `file-location' to read the location. * But make these be read-only. --- diff --git a/src/module-impl.lisp b/src/module-impl.lisp index fe6b545..08679ce 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -144,11 +144,10 @@ ;;;-------------------------------------------------------------------------- ;;; Code fragments. -(export 'c-fragment) +(export '(c-fragment c-fragment-text)) (defclass c-fragment () - ((location :initarg :location :type file-location - :accessor c-fragment-location) - (text :initarg :text :type string :accessor c-fragment-text)) + ((location :initarg :location :type file-location :reader file-location) + (text :initarg :text :type string :reader c-fragment-text)) (:documentation "Represents a fragment of C code to be written to an output file. @@ -181,7 +180,7 @@ (defmethod print-object ((fragment c-fragment) stream) (let ((text (c-fragment-text fragment)) - (location (c-fragment-location fragment))) + (location (file-location fragment))) (if *print-escape* (print-unreadable-object (fragment stream :type t) (when location