[TxMt] excluding match from language pattern

Quinn Comendant quinn at strangecode.com
Mon Mar 6 07:55:26 UTC 2006


Anybody wish to help me with a pattern for the PHP language bundle? I
have embedded SQL under a variable such as below. I'm having trouble
excluding the addslashes part from the scope.

$sql = "WHERE category = '" . addslashes($category) . "'";

...or...

$qid = DB::query("
    WHERE category = '" . addslashes($category) . "'
");


The pattern I've come up with so far:

{   name = 'meta.scope.sql';
    begin = '(dbQuery|DB::query)\("|\$\w*(sql|where)\w*\s*=\s*"';
    end = '"\)|";';
    patterns = (
        {   include = 'source.sql'; },
    );
    contentName = 'source.sql.embedded';
},


I'm new at this so any help would be appreciated.

Thanks,
Quinn




More information about the textmate mailing list