[TxMt] Trouble modifying language

Michael Sheets mummer at whitefalls.org
Fri Oct 19 03:41:18 UTC 2007


On Oct 18, 2007, at 7:01 PM, Jeremy Sachs wrote:

> The specific part of my language definition that's being  
> troublesome somewhat resembles this:
>
> {	name = 'support.class.actionscript.3';
> 	match = '([\w\.]|\b)(Class1|Class2|Class3| ... |ClassN)\b';
> },
>
> -where N is a very, very large number. About 350. And my problem  
> is, specifically, that some of the words in the match line will  
> behave as if their scope is support.class.actionscript.3, and some  
> of them will behave as if they have no scope.

It would really be helpful for you to just paste the entire grammar  
(via the Paste online command in the Textmate bundle), talking in the  
abstract like this is hard. If the above match is a real example  
there is a much easier way to do it '([\w\.]|\b)(Class\d+)\b'. ie:  
Class followed by any number of digits.

> I'd really like this to work. Are there technical limits to the  
> number of words to specify in a match statement? Does anyone have  
> any suggestions?

And no there is no limit to the number of alternations you can have,  
one of the bundles has one with around 1500 in one match. You must  
have an error in your regex somewhere that is causing it to not match  
some of the items. See above about pasting it. :)



More information about the textmate mailing list