3 " Maintainer: Andreas Fischbach <afisch@altavista.com>
4 " This file is based on sql.vim && java.vim (thanx)
5 " with a handful of additional sql words and still
6 " a subset of whatever standard
7 " Last change: 31th Dec 2001
9 " au BufNewFile,BufRead *.sqlj so $VIM/syntax/sqlj.vim
11 " Remove any old syntax stuff hanging around
14 elseif exists("b:current_syntax")
18 " Read the Java syntax to start with
19 source <sfile>:p:h/java.vim
22 " The SQL reserved words, defined as keywords.
25 syn keyword sqljSpecial null
27 syn keyword sqljKeyword access add as asc by check cluster column
28 syn keyword sqljKeyword compress connect current decimal default
29 syn keyword sqljKeyword desc else exclusive file for from group
30 syn keyword sqljKeyword having identified immediate increment index
31 syn keyword sqljKeyword initial into is level maxextents mode modify
32 syn keyword sqljKeyword nocompress nowait of offline on online start
33 syn keyword sqljKeyword successful synonym table then to trigger uid
34 syn keyword sqljKeyword unique user validate values view whenever
35 syn keyword sqljKeyword where with option order pctfree privileges
36 syn keyword sqljKeyword public resource row rowlabel rownum rows
37 syn keyword sqljKeyword session share size smallint
39 syn keyword sqljKeyword fetch database context iterator field join
40 syn keyword sqljKeyword foreign outer inner isolation left right
41 syn keyword sqljKeyword match primary key
43 syn keyword sqljOperator not and or
44 syn keyword sqljOperator in any some all between exists
45 syn keyword sqljOperator like escape
46 syn keyword sqljOperator union intersect minus
47 syn keyword sqljOperator prior distinct
48 syn keyword sqljOperator sysdate
50 syn keyword sqljOperator max min avg sum count hex
52 syn keyword sqljStatement alter analyze audit comment commit create
53 syn keyword sqljStatement delete drop explain grant insert lock noaudit
54 syn keyword sqljStatement rename revoke rollback savepoint select set
55 syn keyword sqljStatement truncate update begin work
57 syn keyword sqljType char character date long raw mlslabel number
58 syn keyword sqljType rowid varchar varchar2 float integer
60 syn keyword sqljType byte text serial
63 " Strings and characters:
64 syn region sqljString start=+"+ skip=+\\\\\|\\"+ end=+"+
65 syn region sqljString start=+'+ skip=+\\\\\|\\"+ end=+'+
68 syn match sqljNumber "-\=\<\d*\.\=[0-9_]\>"
71 syn match sqljPre "#sql"
74 syn region sqljComment start="/\*" end="\*/"
75 syn match sqlComment "--.*"
77 syn sync ccomment sqljComment
79 if version >= 508 || !exists("did_sqlj_syn_inits")
81 let did_sqlj_syn_inits = 1
82 command! -nargs=+ HiLink hi link <args>
84 command! -nargs=+ HiLink hi def link <args>
87 " The default methods for highlighting. Can be overridden later.
88 HiLink sqljComment Comment
89 HiLink sqljKeyword sqljSpecial
90 HiLink sqljNumber Number
91 HiLink sqljOperator sqljStatement
92 HiLink sqljSpecial Special
93 HiLink sqljStatement Statement
94 HiLink sqljString String
96 HiLink sqljPre PreProc
101 let b:current_syntax = "sqlj"