[TxMt] more language grammar woe

sam aaron sam.maillists at googlemail.com
Mon Oct 9 13:17:37 UTC 2006


Hi there,

I'm starting to feel really useless now! I'm trying to write a
language grammar for the latex TODO bundle
(http://tug.ctan.org/tex-archive/macros/latex/contrib/todo/)

When used, it produces a nice todo file that looks like the following:

(abstract) l.4, p iii, s : expand upon this `argument'
(introduction) l.17, p 1, s 1.1: Did I just think these categories up,
or did they come from somewhere?
(introduction) l.26, p 1, s 1.1: Back these definitions with
references to the literature
(background) l.37, p 10, s 2.1.1: is there actually an example of a
virtual environment with no users?
(background) l.67, p 11, s 2.1.1: fill out this section with a
complete range of quotes

Currently I just want to add syntax highlighting to this document. I
have created my own bundle (LaTeXTODO), and inside my own language
file: (LaTeXTODO). This language file looks as follows:

{	scopeName = 'source.latex_todo';
	fileTypes = ( 'TODO' );
	patterns = (
		{	match = '^(\(.*?\))';
			captures = { 1 = { name = 'entity.name.latex_todo'; }; };
		}
	);
}

I was hoping it would match the first bracketed word in each sentence
(abstract), (introduction), etc. and scope them as
'entity.name.latex_todo'. Unfortunately this doesn't seem to be the
case. For some very strange reason, when i click on (abstract), and
hit the short-cut ctrl-shift-p it says that the scope is
tex.log.latex.

This is very odd, and the language menu at the bottom definitely says
i'm in LaTeXTODO mode. I'm really at a loss with what to do with
languages grammars now, and i'm almost wondering whether TextMate is
playing fairly...

Yours in hope of any help at all,
Sam Aaron



More information about the textmate mailing list