On Fri, 3 Oct 2014 02:18:32 +0200, martijn brekelmans <tijntj...@msn.com> wrote:
> I'm trying out readable, and I'm already finding it brilliant. I found a 
> little bug however, in common lisp, when the file doesn't end with an empty 
> line, it will throw an Error, Error: Unexpected text after n-expression.
> 
> Code can be found here
> 
> When I add a newline at the end of the file, all works well again. I'm using 
> GNU CLISP 2.49.

Ahah!  I managed to duplicate the bug.

Frankly, I *never* have source code without newline at end-of-file,
so to me this is an incredibly weird case.  That said, we should gracefully 
handle it.

The fix turns out to be trivial, and is included below for your amusement.
Basically, procedure "it-expr-real" didn't handle EOF-without-EOL gracefully.
I expect this patch will be in the next release.

--- David A. Wheeler

=======================================================

--- a/sweet.lisp
+++ b/sweet.lisp
@@ -665,6 +665,8 @@
                                 (read-body stream new-indent)
                     (list body-new-indent (my-append line-value body-value)))
                   (list new-indent (monify line-value)))))
+          ((eof-objectp (my-peek-char stream))
+            (list " " (monify line-value)))
           (t
             (read-error "Unexpected text after n-expression")))
         ; Here, line-exprs begins with something special like GROUP-SPLIT:


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to