From: Mark Wooding Date: Wed, 18 Nov 2009 13:28:06 +0000 (+0000) Subject: cl: Tidy up parser slightly. X-Git-Url: https://git.distorted.org.uk/~mdw/fringe/commitdiff_plain/d782cc40f017562d106f186120df185d9995bc69 cl: Tidy up parser slightly. Most of the other implementations don't have separate cases for end-of- input and not-open-paren; so don't penalize Lisp because I decided to make the parser more extendable. --- diff --git a/cl-fringe.lisp b/cl-fringe.lisp index 3716f3b..a2ddf85 100644 --- a/cl-fringe.lisp +++ b/cl-fringe.lisp @@ -63,9 +63,7 @@ (let ((len (length string))) (labels ((parse (i) - (cond ((>= i len) - (values nil i)) - ((char= (char string i) #\() + (cond ((and (< i len) (char= (char string i) #\()) (multiple-value-bind (left i) (parse (1+ i)) (unless (< i len) (error "no data")) (let ((data (char string i)))