[TxMt] Language grammar regexp inconsistency or blunder on my part?

Alakazam alakazam at melix.net
Sun May 14 23:36:29 UTC 2006


Hello Michael,

 From the manual :

> Note that the regular expressions are matched against only a single  
> line of the document at a time. That means it is not possible to  
> use a pattern that matches multiple lines. The reason for this is  
> technical: being able to restart the parser at an arbitrary line  
> and having to re-parse only the minimal number of lines affected by  
> an edit. In most situations it‍ is possible to use the begin/end  
> model to overcome this limitation.

http://macromates.com/textmate/manual/language_grammars#language_rules

I guess this is the limitation you are encountering.
-- 
Alakazam

alakazam at melix.net


On 15 mai 06, at 01:04, Michael Daines wrote:

> Hello,
>
> I've been fooling around a little with trying to create a language  
> grammar for guitar tablature, and I ran into a problem with  
> matching something like this:
>
>   E 0-------|--------|--------|
>   B --0-----|0-------|--------|
>   G ----0---|--0-----|0-------|
>   D ------0-|----0---|--0-----|
>   A --------|------0-|----0---|
>   E --------|--------|------0-|
>
> I should probably know my TERMINOLOGY better in order to do this,  
> but I'm calling this thing a "block" for now. Every document will  
> have 1 or more of these. I attempted to write a rule that would  
> match one these things:
>
>   {
>     name = 'block.tablature';
>     match = '([A-G].+\n){6}';
>   }
>
> This doesn't seem to match a section like this, but if I use the  
> find command with that regexp, the "block" is found and selected.  
> What am I missing?
>
>
> -- Michael
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>




More information about the textmate mailing list