[TxMt] (Another) Language grammar question

Michael Sheets mummer at whitefalls.org
Sun Jun 3 23:54:35 UTC 2007


On Jun 3, 2007, at 5:57 PM, Édouard Gilbert wrote:

> 		{	name = 'meta.class.lisp.openmusic';
> 			match = '(\b(defclass|defclass\*)\b)(\s+)((\w|\-|\!|\?)*)';
> 			captures = {
> 				2 = { name = 'storage.type.class.lisp.openmusic'; };
> 				4 = { name = 'entity.name.class.lisp.openmusic'; };
> 			# Of course, there are still plenty of things missing.
> 		};

It's the \*\b bit that screws it up, \b is word boundry, ie: only  
true if the char to one side of \b is a word char and the other side  
not. It works for the first alternation because s is a word  
character, * isn't. You already have in the regex there that there is  
at least one whitespace character following that alternation so that  
\b isn't serving any purpose anyway, just remove it. (But leave the  
first one, it is serving a good purpose.)


More information about the textmate mailing list