7
|
1 " Vim syntax file
|
|
2 " Language: sqlj
|
|
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
|
|
8
|
|
9 " au BufNewFile,BufRead *.sqlj so $VIM/syntax/sqlj.vim
|
|
10
|
|
11 " Remove any old syntax stuff hanging around
|
|
12 if version < 600
|
|
13 syntax clear
|
|
14 elseif exists("b:current_syntax")
|
|
15 finish
|
|
16 endif
|
|
17
|
|
18 " Read the Java syntax to start with
|
|
19 source <sfile>:p:h/java.vim
|
|
20
|
|
21 " SQLJ extentions
|
|
22 " The SQL reserved words, defined as keywords.
|
|
23
|
|
24 syn case ignore
|
|
25 syn keyword sqljSpecial null
|
|
26
|
|
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
|
|
38
|
|
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
|
|
42
|
|
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
|
|
49
|
|
50 syn keyword sqljOperator max min avg sum count hex
|
|
51
|
|
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
|
|
56
|
|
57 syn keyword sqljType char character date long raw mlslabel number
|
|
58 syn keyword sqljType rowid varchar varchar2 float integer
|
|
59
|
|
60 syn keyword sqljType byte text serial
|
|
61
|
|
62
|
|
63 " Strings and characters:
|
|
64 syn region sqljString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
65 syn region sqljString start=+'+ skip=+\\\\\|\\"+ end=+'+
|
|
66
|
|
67 " Numbers:
|
|
68 syn match sqljNumber "-\=\<\d*\.\=[0-9_]\>"
|
|
69
|
|
70 " PreProc
|
|
71 syn match sqljPre "#sql"
|
|
72
|
|
73 " Comments:
|
|
74 syn region sqljComment start="/\*" end="\*/"
|
|
75 syn match sqlComment "--.*"
|
|
76
|
|
77 syn sync ccomment sqljComment
|
|
78
|
|
79 if version >= 508 || !exists("did_sqlj_syn_inits")
|
|
80 if version < 508
|
|
81 let did_sqlj_syn_inits = 1
|
|
82 command! -nargs=+ HiLink hi link <args>
|
|
83 else
|
|
84 command! -nargs=+ HiLink hi def link <args>
|
|
85 endif
|
|
86
|
|
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
|
|
95 HiLink sqljType Type
|
|
96 HiLink sqljPre PreProc
|
839
|
97
|
|
98 delcommand HiLink
|
7
|
99 endif
|
|
100
|
|
101 let b:current_syntax = "sqlj"
|
|
102
|