Format
This commit is contained in:
parent
8c539dc879
commit
bc2bc378c7
1 changed files with 10 additions and 9 deletions
|
@ -46,15 +46,16 @@
|
||||||
(defun minify (input-string)
|
(defun minify (input-string)
|
||||||
(with-output-to-string (out)
|
(with-output-to-string (out)
|
||||||
(let ((previous-space-p nil))
|
(let ((previous-space-p nil))
|
||||||
(loop for char across input-string do
|
(loop
|
||||||
(cond
|
:for char :across input-string
|
||||||
((whitespace-p char)
|
:do (cond
|
||||||
(unless previous-space-p
|
((whitespace-p char)
|
||||||
(write-char #\Space out))
|
(unless previous-space-p
|
||||||
(setf previous-space-p t))
|
(write-char #\Space out))
|
||||||
(t
|
(setf previous-space-p t))
|
||||||
(write-char char out)
|
(t
|
||||||
(setf previous-space-p nil)))))))
|
(write-char char out)
|
||||||
|
(setf previous-space-p nil)))))))
|
||||||
|
|
||||||
(defun whitespace-p (char)
|
(defun whitespace-p (char)
|
||||||
(member char '(#\Space #\Newline #\Tab #\Return) :test #'char=))
|
(member char '(#\Space #\Newline #\Tab #\Return) :test #'char=))
|
||||||
|
|
Loading…
Reference in a new issue