[SVN] More name revising

Allan Odgaard allan at macromates.com
Wed May 4 12:47:58 UTC 2005

First a big thank you to all who've contributed in the last weeks 
standardizing names in the language definitions -- I went through all 
of it yesterday, and it's looking very good, especially considering my 
passiveness in giving exact definitions (religion taught me that order 
comes from chaos! ;) ).

One thing I'd like to fix is the keyword group. This is overloaded, and 
too many different names at the second level, making it hard to apply 
general styles to everything but keyword itself, but that touches too 
much IMHO, so here is my proposal:

Move keyword.function to its own group and let this contain all 
functions, methods, classes, types and constants defined by a 
framework, library or similar, e.g. (examples from Cocoa):
    support.function -- NSBeep, …
    support.class    -- NSWindow, NSString, …
    support.type     -- NSRect, …
    support.constant -- NSZeroRect, …
support.function include methods (if we really want to match these?!?).

Then restrain ourself to these 3 keyword groups:
    keyword.storage  -- static, final, abstract, class, function, int, 
var, …
    keyword.control  -- continue, while, if, return, break, try, do, 
end, throw, …
    keyword.operator -- instanceof, dynamic_cast, and, or, not, …
Keyword.storage should probably be divided into keyword.storage.type 
and keyword.storage.modifier.

Another group which is also currently a little diffuse is constant, I 
suggest these 3:
    constant.numeric   -- 42, 1.3f, 0x4AB1U, …
    constant.character -- <, \e, \031, '"', …
    constant.language  -- true, false, nil, YES, NO, …

If something doesn't go into either of these defined groups, I'd 
suggest we put it in 
<most-appropriate-group>.other.<suggested-category>. This makes it 
easier to see what goes outside the normal definitions, and should 
reduce the number of second-level groups, which helps styling.

I expect the default themes will style only keyword, support, and 
constant (i.e. all children of these will be styled identical by 
default). The same goes for comment, string, variable, invalid, 
entity.name, and entity.parameter.

I intend to update the wiki page after making sure that these suggested 
groups are not too limiting, or there are better naming suggestions.

Something semi-related, when writing language definition files, 
formatting the rules like this:
     {   name = "foo";
Makes it possible to fold rules and still see the name of them. Try 
e.g. HTML.plist for an example -- it makes it a bit easier to work with 
the larger files.

Kind regards Allan

More information about the textmate-dev mailing list