Hello,
I am developing a new Vim syntax file for SQL Server 2005/2008 and am
having difficulty figuring out a small highlighting issue.
I've defined a keyword "set" as follows:
syn keyword tsqlKeyword set
I've also defined keywords related to server options:
syn keyword svrOption ANSI_DEFAULTS ANSI_NULL_DFLT_OFF
...
syn keyword svrOption XACT_ABORT
Lastly, I've defined user variables:
syn match tsqlVariable "@[EMAIL PROTECTED]>"
There are three contexts when "set" might be used:
1. To set a server option ("SET ANSI_DEFAULTS ON")
2. To assign a user variable ("SET @Answer = 42)
3. As part of an update query ("UPDATE MyTable SET Answer = 42")
For cases #2 and #3, I want "set" to simply be highlighted as a
statement. So I've defined:
HiLink tsqlKeyword Statement
However, for case #1, I want to highlight the entire "set [server
option] [option value]" region as PreProc. In this scenario, the
region is defined as a) starts with "set", b) ends with either a
semicolon or the end-of-line, and c) contains any one of the keywords
defined in syntax group "svrOption".
I've fiddled endlessly with the syn region definition, but cannot seem
to get this working. Thanks in advance for any assistance.
- Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---