Skip to content

Commit

Permalink
changed if to cond in read-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
YarinHeffes authored and stylewarning committed Jan 13, 2025
1 parent ee53a23 commit d9c9f21
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/parser/toplevel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -571,17 +571,19 @@ If MODE is :macro, a package form is forbidden, and an explicit check is made fo
(- (file-position stream) 1))
"missing expression")))

(let ((forms nil))
(let ((additional-forms nil))
;; Read multiple forms if present.
(block collect-forms
(block collect-additional-forms
(loop (multiple-value-bind (next-form presentp)
(maybe-read-form stream source *coalton-eclector-client*)
(if presentp
(push next-form forms)
(return-from collect-forms)))))
(if forms
(parse-expressions (cons form (nreverse forms)) source)
(parse-expression form source))))))
(push next-form additional-forms)
(return-from collect-additional-forms)))))
(cond
((consp additional-forms)
(parse-expressions (cons form (nreverse additional-forms)) source))
(t
(parse-expression form source)))))))

;;; Packages

Expand Down

0 comments on commit d9c9f21

Please sign in to comment.