Skip to content

Commit

Permalink
extract function "print-nodes"
Browse files Browse the repository at this point in the history
  • Loading branch information
fstamour committed Dec 23, 2024
1 parent 6a09b6a commit 6a52ea4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lossless-reader.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,14 @@ common lisp.")
(list children)
children)))

(defun print-nodes (stream nodes colonp atp)
(declare (ignore colonp atp))
(format stream "(list ~{~s~^ ~})" nodes))

(defmethod print-object ((node node) stream)
(let ((*print-case* :downcase)
(children (node-children node)))
(format stream "(~:[node '~;~]~s ~d ~d~:[ ~s~;~@[ (list ~{~s~^ ~})~]~])"
(format stream "(~:[node '~;~]~s ~d ~d~:[ ~s~;~@[ ~/breeze.lossless-reader::print-nodes/~]~])"
(member (node-type node)
'(parens
token
Expand Down

0 comments on commit 6a52ea4

Please sign in to comment.