Improve GeSHi syntax highlighting for T-SQL

You can do this by adding a PARSER_CONTROL control to the end of the array:

'PARSER_CONTROL' => array(
    'KEYWORDS' => array(
        1 => array( // "1" maps to the main keywords near the start of the array
            'DISALLOWED_BEFORE' => '(?![\(\w])',
            'DISALLOWED_AFTER' => '(?![\(\w])'
        ),
        5 => array( // "5" maps to the shorter keywords like "IN" that are further down
            'DISALLOWED_BEFORE' => '(?![\(\w])',
            'DISALLOWED_AFTER' => '(?![\(\w])'
        ),
    )
)

Edit

I’ve modified your gist to move some of the keywords you added to SYMBOLS back to KEYWORDS (though in their own group and with your custom style), and I updated the PARSER_CONTROL array to match the new keyword array indexes and also to include the default regex that geshi generates. Here is the link:

https://gist.github.com/jamend/07e60bf0b9acdfdeee7a

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)