|
Re: Language grammar feature writeup: msg#00203editors.textmate.general
Stefan I'll try to explain the logic behind the LaTeX section rule and the various names. { name = "meta.section.latex"; begin = "((\\\\(?:(?:sub)*section|chapter|paragraph| part))(\\*?)(?:(\\[)[^\\[]*?(\\]))??(\\{))"; end = "(\\}$)"; captures = { 1 = { name = "support.function.section.latex"; }; }; patterns = ( { name = "entity.name.section"; match = "[^}]+"; } ); }, This rule should match LaTeX markup like: \section{Introduction} The reason that the name for the whole rule uses meta is that we will never (probably) style the entire section pattern. It is really just a container for the parts that we want to style which are: the \section command itself, and the section name. The section command falls under the support.function group since we can think of sectioning commands in LaTeX like library functions. In general support.xxx is to be used for library like components of al the languages. The name of the section "Introduction" for example is an entity in the LaTeX document. Therefore it falls under the entity.name group. Entities are for class names, function names, variable names, and the like. It helps to look at the overall scheme and the examples provided here: http://macromates.com/wiki/pmwiki?n=Main.NamingLanguageElements It takes some getting used to, particularly for a languages like TeX/ LaTeX. Brad On Jun 23, 2005, at 5:05 AM, Stefan Brantschen wrote: Thanks, this is sort of pretty timely for me...! :-) |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Relative paths in shell variable: 00203, Brian Lalor |
|---|---|
| Next by Date: | Autoabbreviation?: 00203, Ben Jackson |
| Previous by Thread: | Re: Language grammar feature writeupi: 00203, Stefan Brantschen |
| Next by Thread: | qq|...| in Perl bundle: 00203, Andrew Green |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |