Browse code
chore: reformat
Ed Langley authored on 20/11/2019 18:37:38
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -5,15 +5,15 @@ |
5 | 5 |
(defun read-block (stream) |
6 | 6 |
(when (char= (read-char stream) #\{) |
7 | 7 |
(loop |
8 |
- with block = (make-string-output-stream) |
|
9 |
- with count = 0 |
|
10 |
- for char = (read-char stream) |
|
11 |
- until (and (char= char #\}) (= count 0)) |
|
12 |
- when (char= char #\{) do (incf count) |
|
13 |
- when (char= char #\}) do (decf count) |
|
14 |
- do (write-char char block) |
|
15 |
- finally |
|
16 |
- (return (get-output-stream-string block))))) |
|
8 |
+ with block = (make-string-output-stream) |
|
9 |
+ with count = 0 |
|
10 |
+ for char = (read-char stream) |
|
11 |
+ until (and (char= char #\}) (= count 0)) |
|
12 |
+ when (char= char #\{) do (incf count) |
|
13 |
+ when (char= char #\}) do (decf count) |
|
14 |
+ do (write-char char block) |
|
15 |
+ finally |
|
16 |
+ (return (get-output-stream-string block))))) |
|
17 | 17 |
|
18 | 18 |
(defun read-to-block (stream) |
19 | 19 |
(with-output-to-string (s) |
... | ... |
@@ -24,10 +24,10 @@ |
24 | 24 |
(defun partition (char string &key from-end) |
25 | 25 |
(let ((pos (position char string :from-end from-end))) |
26 | 26 |
(if pos |
27 |
- (list (subseq string 0 pos) |
|
28 |
- (subseq string (1+ pos))) |
|
29 |
- (list nil |
|
30 |
- string)))) |
|
27 |
+ (list (subseq string 0 pos) |
|
28 |
+ (subseq string (1+ pos))) |
|
29 |
+ (list nil |
|
30 |
+ string)))) |
|
31 | 31 |
|
32 | 32 |
(defun parse-rule (block) |
33 | 33 |
(remove-if-not #'car |
... | ... |
@@ -50,24 +50,24 @@ |
50 | 50 |
|
51 | 51 |
(defun parse-file (stream) |
52 | 52 |
(loop with result = (list) |
53 |
- with done = nil |
|
54 |
- until done |
|
55 |
- do |
|
56 |
- (handler-case (push (read-rule stream) |
|
57 |
- result) |
|
58 |
- (end-of-file (c) c (setf done t))) |
|
59 |
- finally |
|
60 |
- (return (nreverse result)))) |
|
53 |
+ with done = nil |
|
54 |
+ until done |
|
55 |
+ do |
|
56 |
+ (handler-case (push (read-rule stream) |
|
57 |
+ result) |
|
58 |
+ (end-of-file (c) c (setf done t))) |
|
59 |
+ finally |
|
60 |
+ (return (nreverse result)))) |
|
61 | 61 |
|
62 | 62 |
(defun collapse-rule (rule) |
63 | 63 |
(let ((selector (car rule))) |
64 | 64 |
(mapcan (serapeum:op (mapcar (lambda (x) (list x _)) |
65 |
- selector)) |
|
66 |
- (cdr rule)))) |
|
65 |
+ selector)) |
|
66 |
+ (cdr rule)))) |
|
67 | 67 |
|
68 | 68 |
(defun reconstitute (rules) |
69 | 69 |
(loop for (selector (property value)) in rules |
70 |
- collect (format nil "~a { ~a: ~a; }" selector property value))) |
|
70 |
+ collect (format nil "~a { ~a: ~a; }" selector property value))) |
|
71 | 71 |
|
72 | 72 |
(defun normalize-file (stream) |
73 | 73 |
(fw.lu:let-each (:be *) |