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