[SVN] language help

Daniel Stockman daniel.stockman at gmail.com
Wed Apr 16 19:15:13 UTC 2008


To capture 'validate', which is the name of the function:

> <cffunction name="validate" returnType="array" access="private"  
> hint="returns error array">

Place this in your repository:

cffunction = {
   name = 'meta.tag.language.cfml.function';
   begin = '<(cffunction)';
   end = '>';
   captures = { 1 = { name = 'entity.name.tag.cfml'; }; };
   patterns = (
     { match = '(?<=name=)(")([A-Za-z$_0-9]+)(")';
       captures = {
         0 = { name = 'string.quoted.double.cfml'; };
         1 = { name = 'punctuation.definition.string.begin'; };
         2 = { name = 'entity.name.function-name.cfml'; };
         3 = { name = 'punctuation.definition.string.end'; };
       };
     },
     { include = 'source.cfml'; },
     { include = '#tag-stuff'; },
   );
};

In the main patterns loop, simply { include = '#cffunction'; }  
somewhere before the end. This does assume a "source.cfml" scope  
exists, which probably doesn't exist on the "official" bundle, as I  
have hacked it severely for my own use/preferences.

Once it's all in place, all you need to do is define a color for the  
'entity.name.function-name.cfml' scope. (For simplicity, I took out  
the check for double or single quotes. Single quotes around attribute  
values are evil)

Hope this helps,

Daniel
http://evocateur.org/



More information about the textmate-dev mailing list