summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-11-26 19:24:43 +0100
committertomsmeding <tom.smeding@gmail.com>2019-11-26 19:24:43 +0100
commit5af875717bbbb3892fbe3b92783804a3b62841a6 (patch)
tree94a6c2aac8a35cc7d54390ef30999f371bb32111
parent3024eac0b5743f08cfc2af6aa98ade17ced3a1f4 (diff)
Fix bugs in lispparser.lisp
-rw-r--r--tests/lispparser.lisp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/lispparser.lisp b/tests/lispparser.lisp
index 61f4e47..b6dfb67 100644
--- a/tests/lispparser.lisp
+++ b/tests/lispparser.lisp
@@ -101,7 +101,7 @@
(= ch "x")
(let ((h1 (parse-hex-digit (substr 1 1 str)))
(h2 (parse-hex-digit (substr 2 1 str))))
- (list (chr (16 * h1 + h2)) (substr 3 -1 str)))
+ (list (chr (+ (* 16 h1) h2)) (substr 3 -1 str)))
(error "Invalid string escape character " ch))))
; string[input] string[string to prepend to result] -> (string[parsed till bare "] string[rest])
@@ -299,9 +299,11 @@
(print-program (lambdarec rec (items)
(if (null? items)
""
- (concat-list
- (map (lambda (i) (concat "\n" (pretty-ast i)))
- (cdr items)))))))
+ (concat
+ (pretty-ast (car items))
+ (concat-list
+ (map (lambda (i) (concat "\n" (pretty-ast i)))
+ (cdr items))))))))
(cond
(= (car ast) 'program)
(print-program (cdr ast))