[TxMt] Language Grammar

Teifion Jordan sarkalian at gmail.com
Thu Apr 24 16:38:26 UTC 2008


Hi

I am trying to add a clause to my PHP language grammar that only  
affects a variable between square brackets/braces, for example it  
would match $bar from the following

$foo[$bar]

The language block I have is this

		var_index = {
			name = 'variable.other.index.php';
			match = '(?x)
			            \[(\$+)[a-zA-Z_\x{7f}-\x{ff}]
			            [a-zA-Z0-9_\x{7f}-\x{ff}]*?\b\]';
			captures = { 1 = { name =  
'punctuation.definition.variable.php'; }; };
		};

The problem is that it affects the square brackets/braces as well as  
the variable inside them. How do I alter it to only affect the  
variable and not the brackets/braces?

Thanks in advance for any help
Teifion

––––––––––––––––––
http://woarl.com/blog




More information about the textmate mailing list