[TxMt] Re: Use begin marker of a scope to end the previous one

Allan Odgaard mailinglist at textmate.org
Thu Mar 19 18:00:40 UTC 2009


On 16 Mar 2009, at 11:01, Édouard Gilbert wrote:

> [...]
> Watch out for grammar bugs, however.  It’s easy to make TM crash if  
> you write things like:
>
> begin = '(?=a)'
> end = '(?=b)'
>
> because neither expression consume a character. [...]

For the records, you’d need to make it:

   begin = '(?=a)'
   end = '(?=a)'

Here, if the ‘patterns’ active between begin/end do not consume  
anything, we have the infinite loop. In your example the parser would  
have advanced to “just before b”, so the same rule would not be  
applicable at the same position.





More information about the textmate mailing list