On Sat, Aug 08, 2009 at 05:45:40PM -0400, Austin Hastings wrote:
> [...]
> Specifically, is
>     token { ... <?after x > }
> going to match the same pattern as
>     rule { ... <?after x > }
> ??
>
> I ask because (I just did it, and) with rules encouraging the liberal  
> use of whitespace, and implicitly generating <.ws> matches, something 
> like:
>     rule { X <?after X> }
> will insert a <.ws> before the <?after>, which the after-block should  
> then be aware of.

Why should the after-block be (automatically?) aware of the <.ws>?

Put another way, afaik <?after ...> is just a subrule like any 
other -- it doesn't get any special syntactic significance
that enables it to be aware of its surroundings.  I would say that
the rule should be either

    rule { X<?after X> }

or if checking the whitespace is desired, it should be

    rule { X <?after [X ] > }   # note whitespace after the X

> So, I suppose the question is, does <?after> always behave a certain  
> way, ratchet-wise, and if so what is it? Or does it take its mode from  
> the surrounding context, or something else?

Ultimately I think that <?after ... > behaves the same as any other
subrule, and its pattern takes its ratchet/sigspace mode from the 
surrounding pattern scope.

Pm

Reply via email to