[SVN] Help with language grammar

Mads Hartmann Jensen mads379 at gmail.com
Fri Nov 19 14:14:28 UTC 2010


Hey guys,

I have the two follwing rules in my repository: 

regexp-triple = {
    name = 'string.quoted.regex.scala';
    begin = '"""';
    end = '"""\.r';
    patterns = (
        {   include = 'source.regexp.oniguruma'; },
    );
};

string-triple = {
    name = 'string.quoted.triple.scala';
    begin = '"""';
    end = '"""';
}

If I use this and have something like this: 

val myvar = """42"""
val something else = ....

It will highlight everything after the first """ because that's the beginning of string.quoted.regexp.scala and it won't stop because there's no .r at the end.

Is there a trick I can do to only begin matching the string.quoted.regexp.scala iff it ends with .r - otherwise it should fall back to string.quoted.triple.scala.

Thanks,
Mads Hartmann Jensen



More information about the textmate-dev mailing list