-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
For a new language Grammar I have set up a couple of test bundles that try different variations of a grammar style, so I stumbled over some 'cases' where an actual name rule at the pattern root level of the syntax would not be recognized at all.
EXAMPLE.:
{ name = 'entity.tag.plugin.single.textpattern'; match = 'txp:[a-z]{3}(_([a-z0-9]{1,15}))(_([a-z0-9]{1,15}))?\s{,4}(\w{1,45}="\w{,15}"\s{,8}){,7}/'; },
Basically I want to use the above rule to isolate any single self enclosing language plugin tags tags from regular txp language tags and give it a scope. It doesn't work, I tested the above reg ex with find/replace and it does what I want, but it doesn't work inside the Language grammar. For the rest of the tags, I use the usual word boundaries rules with a piped group of tag names, as in html.
So I suspected, that something like that is not allowed maybe.(Onigoruma ?) NOTE.: I didn't use any back references there,just to simplify the case
What am I doing wrong?I'm using cutting edge with all bundles installed.
Are there any limitations, about regexes in a Language syntax at all, that I don't know about ?
regards, marios
On 28/5/2006, at 17:42, marios buttner wrote:
[...] Basically I want to use the above rule to isolate any single self enclosing language plugin tags tags from regular txp language tags and give it a scope. It doesn't work, I tested the above reg ex with find/replace and it does what I want, but it doesn't work inside the Language grammar.
Did you place this first in the patterns array?
TextMate will pick the first rule which match something, so if something more generic matches the same text (tag) and is specified before this rule, it will win.
Are there any limitations, about regexes in a Language syntax at all, that I don't know about ?
Other than patterns only working at a single line at a time, there are no limitations compared to normal regexp find.