[antlr-interest] eating newlines

Jamie Herre jlst at gettysgroup.com
Tue Sep 28 09:43:13 PDT 2004


On Sep 27, 2004, at 6:34 PM, Terence Parr wrote:

> Often I want "fubar", but I get "fubar\n".

Story of my life, man.

>
> My proposal is thus to be absolutely consistent: kill a single newline
> after <if>, <<, <else>, and <endif> (if on line by itself) as it does
> now.  Then kill newlines *before* <else> and <endif> and >>.  Anybody
> want to comment?

This seems reasonable but it still results in significant yet unquoted 
whitespace which I abhor.  Maybe you could also allow an explicit 
escaped newline like this for neat-freaks like me.

<if(LEXER)>
      System.err.println("<description>: no viable alt line "+getLine()+"
c='"+(char)input.LA(1)+"'");<\n>
<else>
      System.err.println("<description>: no viable alt line
token="+((TokenStream)input).LT(1));<\n>
<endif>

And yes, I agree that python is awesome. But nevertheless...

-Jamie



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list