blob: 2992d8be472ed7b9b07c43894373cccad06e8656 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Stored Procedures (STP)
3" Maintainer: Jeff Lanzarotta (jefflanzarotta@yahoo.com)
4" URL: http://lanzarotta.tripod.com/vim/syntax/stp.vim.zip
5" Last Change: March 05, 2002
6
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
12syn case ignore
13
14" Specials.
15syn keyword stpSpecial null
16
17" Keywords.
18syn keyword stpKeyword begin break call case create deallocate dynamic
19syn keyword stpKeyword execute from function go grant
20syn keyword stpKeyword index insert into leave max min on output procedure
21syn keyword stpKeyword public result return returns scroll table to
22syn keyword stpKeyword when
23syn match stpKeyword "\<end\>"
24
25" Conditional.
26syn keyword stpConditional if else elseif then
27syn match stpConditional "\<end\s\+if\>"
28
29" Repeats.
30syn keyword stpRepeat for while loop
31syn match stpRepeat "\<end\s\+loop\>"
32
33" Operators.
34syn keyword stpOperator asc not and or desc group having in is any some all
35syn keyword stpOperator between exists like escape with union intersect minus
36syn keyword stpOperator out prior distinct sysdate
37
38" Statements.
39syn keyword stpStatement alter analyze as audit avg by close clustered comment
40syn keyword stpStatement commit continue count create cursor declare delete
41syn keyword stpStatement drop exec execute explain fetch from index insert
42syn keyword stpStatement into lock max min next noaudit nonclustered open
43syn keyword stpStatement order output print raiserror recompile rename revoke
44syn keyword stpStatement rollback savepoint select set sum transaction
45syn keyword stpStatement truncate unique update values where
46
47" Functions.
48syn keyword stpFunction abs acos ascii asin atan atn2 avg ceiling charindex
49syn keyword stpFunction charlength convert col_name col_length cos cot count
50syn keyword stpFunction curunreservedpgs datapgs datalength dateadd datediff
51syn keyword stpFunction datename datepart db_id db_name degree difference
52syn keyword stpFunction exp floor getdate hextoint host_id host_name index_col
53syn keyword stpFunction inttohex isnull lct_admin log log10 lower ltrim max
54syn keyword stpFunction min now object_id object_name patindex pi pos power
55syn keyword stpFunction proc_role radians rand replace replicate reserved_pgs
56syn keyword stpFunction reverse right rtrim rowcnt round show_role sign sin
57syn keyword stpFunction soundex space sqrt str stuff substr substring sum
58syn keyword stpFunction suser_id suser_name tan tsequal upper used_pgs user
59syn keyword stpFunction user_id user_name valid_name valid_user message
60
61" Types.
62syn keyword stpType binary bit char datetime decimal double float image
63syn keyword stpType int integer long money nchar numeric precision real
64syn keyword stpType smalldatetime smallint smallmoney text time tinyint
65syn keyword stpType timestamp varbinary varchar
66
67" Globals.
68syn match stpGlobals '@@char_convert'
69syn match stpGlobals '@@cient_csname'
70syn match stpGlobals '@@client_csid'
71syn match stpGlobals '@@connections'
72syn match stpGlobals '@@cpu_busy'
73syn match stpGlobals '@@error'
74syn match stpGlobals '@@identity'
75syn match stpGlobals '@@idle'
76syn match stpGlobals '@@io_busy'
77syn match stpGlobals '@@isolation'
78syn match stpGlobals '@@langid'
79syn match stpGlobals '@@language'
80syn match stpGlobals '@@max_connections'
81syn match stpGlobals '@@maxcharlen'
82syn match stpGlobals '@@ncharsize'
83syn match stpGlobals '@@nestlevel'
84syn match stpGlobals '@@pack_received'
85syn match stpGlobals '@@pack_sent'
86syn match stpGlobals '@@packet_errors'
87syn match stpGlobals '@@procid'
88syn match stpGlobals '@@rowcount'
89syn match stpGlobals '@@servername'
90syn match stpGlobals '@@spid'
91syn match stpGlobals '@@sqlstatus'
92syn match stpGlobals '@@testts'
93syn match stpGlobals '@@textcolid'
94syn match stpGlobals '@@textdbid'
95syn match stpGlobals '@@textobjid'
96syn match stpGlobals '@@textptr'
97syn match stpGlobals '@@textsize'
98syn match stpGlobals '@@thresh_hysteresis'
99syn match stpGlobals '@@timeticks'
100syn match stpGlobals '@@total_error'
101syn match stpGlobals '@@total_read'
102syn match stpGlobals '@@total_write'
103syn match stpGlobals '@@tranchained'
104syn match stpGlobals '@@trancount'
105syn match stpGlobals '@@transtate'
106syn match stpGlobals '@@version'
107
108" Todos.
109syn keyword stpTodo TODO FIXME XXX DEBUG NOTE
110
111" Strings and characters.
112syn match stpStringError "'.*$"
113syn match stpString "'\([^']\|''\)*'"
114
115" Numbers.
116syn match stpNumber "-\=\<\d*\.\=[0-9_]\>"
117
118" Comments.
119syn region stpComment start="/\*" end="\*/" contains=stpTodo
120syn match stpComment "--.*" contains=stpTodo
121syn sync ccomment stpComment
122
123" Parens.
124syn region stpParen transparent start='(' end=')' contains=ALLBUT,stpParenError
125syn match stpParenError ")"
126
127" Syntax Synchronizing.
128syn sync minlines=10 maxlines=100
129
130" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200131" Only when and item doesn't have highlighting yet.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200133hi def link stpConditional Conditional
134hi def link stpComment Comment
135hi def link stpKeyword Keyword
136hi def link stpNumber Number
137hi def link stpOperator Operator
138hi def link stpSpecial Special
139hi def link stpStatement Statement
140hi def link stpString String
141hi def link stpStringError Error
142hi def link stpType Type
143hi def link stpTodo Todo
144hi def link stpFunction Function
145hi def link stpGlobals Macro
146hi def link stpParen Normal
147hi def link stpParenError Error
148hi def link stpSQLKeyword Function
149hi def link stpRepeat Repeat
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
152let b:current_syntax = "stp"
153
154" vim ts=8 sw=2