diff options
Diffstat (limited to 'tests/lispparser.lisp')
| -rw-r--r-- | tests/lispparser.lisp | 18 | 
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/lispparser.lisp b/tests/lispparser.lisp index df1ed32..13ed8d2 100644 --- a/tests/lispparser.lisp +++ b/tests/lispparser.lisp @@ -14,7 +14,7 @@                                          (= ch "\0") "\\0"                                          (= ch "\"") "\\\""                                          (= ch "\\") "\\\\" -                                        (< n 32) (concat "\\x" (concat (hexdigit (/ n 16)) (hexdigit (mod n 16)))) +                                        (< n 32) (concat "\\x" (hexdigit (/ n 16)) (hexdigit (mod n 16)))                                          ch)))                              (rec (substr 1 -1 str) (concat yet out)))))))          (go str ""))) @@ -28,7 +28,7 @@                      (= clr 'blue) "34"                      (= clr 'cyan) "36"                      (error "Unknown color in ansi-color" clr)))) -        (concat (concat "\x1B[" (concat style "m")) (concat str "\x1B[0m")))) +        (concat "\x1B[" style "m" str "\x1B[0m")))  ; char string -> bool  (define str-elem (ch str) @@ -185,21 +185,20 @@              (= tag 'quote)                  (ansi-color 'green "'")              (= tag 'string) -                (ansi-color 'yellow (concat "\"" (concat (string-escape field) "\""))) +                (ansi-color 'yellow (concat "\"" (string-escape field) "\""))              (= tag 'number)                  (ansi-color 'blue (number->string field))              (= tag 'name)                  field              (= tag 'include) -                (concat (concat (ansi-color 'cyan "#include") " ") (ansi-color 'yellow (concat "\"" (concat (string-escape field) "\"")))) +                (concat (ansi-color 'cyan "#include") " " (ansi-color 'yellow (concat "\"" (string-escape field) "\"")))              (error "Invalid token tag in pretty-token" tag))))  ; tokens -> string  (define pretty-token-list (tokens)      (if (null? tokens)          "" -        (concat (pretty-token (car tokens)) -                (concat " " (pretty-token-list (cdr tokens)))))) +        (concat (pretty-token (car tokens)) " " (pretty-token-list (cdr tokens)))))  ; (define logged-token-fn (name fn)  ;     (lambda (x) @@ -282,7 +281,7 @@          (= (car ast) 'program)              (intercalate " " (map pretty-ast-compact (cdr ast)))          (= (car ast) 'list) -            (concat "(" (concat (intercalate " " (map pretty-ast-compact (cadr ast))) ")")) +            (concat "(" (intercalate " " (map pretty-ast-compact (cadr ast))) ")")          (= (car ast) 'quote)              (concat "'" (pretty-ast-compact (cadr ast)))          (= (car ast) 'string) @@ -303,8 +302,7 @@                                (rest (drop-while isnotnl? str)))                              (if (= rest "")                                  line -                                (concat line -                                        (concat "\n    " (rec (substr 1 -1 rest)))))))) +                                (concat line "\n    " (rec (substr 1 -1 rest)))))))            (indent-items (lambdarec rec (items)                              (if (null? items)                                  "" @@ -325,7 +323,7 @@              (= (car ast) 'program)                  (print-program (cdr ast))              (= (car ast) 'list) -                (concat "(" (concat (indent-items (cadr ast)) ")")) +                (concat "(" (indent-items (cadr ast)) ")")              (= (car ast) 'quote)                  (concat "'" (pretty-ast-compact (cadr ast)))              (= (car ast) 'string)  | 
