On 1/29/13, David A. Wheeler <dwhee...@dwheeler.com> wrote: > I said that my BNF: >> *does* have a bug when processing letterfall, though. letterfall has a >> construct in main.sscm that (simplified) is: >> car $ gettimeofday() >> >> Pretty simple and straightforward. Current unsweeten correctly implements >> this as: >> (car (gettimeofday)) >> >> But "SWEETNEW=new ./unsweeten" incorrectly implements that as: >> (car gettimeofday) >> >> Sigh. It turns out this is a bug in the BNF :-(, so the code is correctly >> implementing a bad spec. I need to track down what's gone wrong. > > Found and fixed. The BNF action rule for "head SUBLIST rhs" used the monify > function, which was completely unnecessary (I think this was a cut-and-paste > from elsewhere and I didn't remove the monify).
That's the first thing I thought when I saw your bug report ^^. > > The new sweet-expression implementation now passes the sweet-expression test > suite, and processes both sweeten.sscm and a version of letterfall > correctly. (Or at least, it produces the same results as the old one did.) Looks good. My approach is still getting modded several times in my head. I think my approach will allow us to use a simple parser combinators sublibrary (but really requires SAME due to the branch after head). I'm a bit busy IRL; I'll try to hack together something using my alternative approach this weekend, but no promises. Feel free to return some of the test cases you removed and add a few more. The test of letterfall is to play it ^^. In theory, all you need to do is replace the readable/kernel.scm with the new version on a fresh-from-the-tarball copy of letterfall and just ./configure && make && ./letterfall. Of course if you need an env variable make sure to do the make inside the SWEETNEW=new env (letterfall itself doesn't use the sweet-reader, only the Makefile does). ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss