On Fri, May 23, 2008 at 2:42 PM, Andrew Whitworth <[EMAIL PROTECTED]> wrote: > On Fri, May 23, 2008 at 6:55 AM, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: >> IIRC, the blank line stuff in .param lines has to do with the >> helper_state non-terminal; this is a kludge to make things work >> currently, as there's a shift/reduce (or reduce/reduce, can't >> remember) conflict otherwise on the statement (instructions) >> non-terminal. >> >> Parsing of '\n' would ideally be done by both the lexer and parser, to >> introduce the concept of 'logical newline', representing one or more >> newlines. I did this in pirc/new, but this is not straightforward, as >> IMCC's macro parser might get in trouble then. > > I can't find a non-terminal called "helper_state" in either the lexer > or the parser, there is a "helper_clear_state" that forces a > precedence onto the clear_state action.
yes that's the one I meant. Sorry, I was being lazy; I wrote that reply from the top of my head, didn't check the source. > > It seems to me that the most straight-forward way to hack this in > would be to add a bare newline in as an alternative to the "sub_param" > non-terminal. This would cause the sub_param to also eat all newlines > between the parameters block and the rest of the subroutine body, but > that shouldn't cause any problems. > > I'll try to throw together a patch for this, see how it works. > > --Andrew Whitworth > great, if it works that'd be good. but personally, IMHO this should be fixed in a major rewrite of the pir grammar eventually (so that all other kludges can be got rid of too); it's more complex than necessary, and not good for maintainenance. kjs