I earlier said: > I've been experimenting with various possible syntaxes for <*...*> in the > ANTLR grammar, here are my current thoughts (I'd like some feedback).
Just after posting, I found a more flexible approach. After <* ("RESTART"), we can still use the "head" production, but make it optional. You can close it using *> on the same line, or not, and we can use that as the trigger. This keeps the weirdness of the restart_list BNF isolated inside the restart productions, which is MUCH better. Something like this: restart_list : RESTART hspace* (head | empty) ( RESTART_END | /*= (push_indent "") */ comment_eol+ (restart_contents | empty )) RESTART_END /*= (restore_indent) */ hspace* ; So that way you can do: let <* x cos(0) *> You can also do: define-library ... <* begin define x {2 * x} define y {2 * y} *> --- 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_123012 _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss