[TxMt] Re: Language grammar, matching multiple lines

Allan Odgaard mailinglist at textmate.org
Fri Mar 13 06:55:45 UTC 2015


On 10 Mar 2015, at 2:30, Jacob Carlborg wrote:

> I have this piece of language grammar to match a struct in D :
> […]
> It will match this code, as an example:
>
> struct Foo(A) if (true)
> {
> }
>
> The problem is if I put the "if" on a new line it won't match. How can 
> I make the rule match across several lines?

This will require breaking up the rule into nested begin/end rules.

I.e. outer rule matches ‘struct Foo(A)’ then its child matches 
‘if’ etc.


More information about the textmate mailing list