The current draft BNF in sweet.g has an interesting difference from our current 
sweet-guile implementation in an edge case, involving the sequence initial-$ 
EOL INDENT.  Any thoughts on the "best" semantic?

In testing, I fed the sweet.g implementation this sequence:
$
\> d e
\<

That is just a stub representation of:
$
! a b

but what, exactly, should that *mean*?   The ANTLR implementation, driven by 
the BNF, interprets that as (((d e))).  This is different from the current 
"unsweeten", which gives  ((d e)).

Frankly, I think the ANTLR BNF is "more right" in this case.  After all, if you 
meant ((d e)), the more obvious way to write that using indentation would be:
\\
!  d e
Since leading "$" forces an additional list in general, a leading "$" with an 
immediate blank line after it should force an *additional* list, which is what 
the BNF does.

It's a pretty odd case; I suspect we could forbid "intiial-$ EOL INDENT" 
without many noticing.  But it does follow from having "as consistent rules as 
possible", and I *do* like consistency as much as we can manage.  So I'm 
inclined to let the ANTLR BNF stand in this case.

We don't need to fix unsweeten at the moment, if this is indeed an error; once 
the BNF is fixed I intend to rewrite the indentation parser which would fix 
that anyway.

Any thoughts?

 --- David A. Wheeler

------------------------------------------------------------------------------
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/learnmore_122712
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to