7
|
1 " Vim syntax file
|
|
2 " Language: Structured Query Report Writer (SQR)
|
|
3 " Maintainer: Nathan Stratton Treadway (nathanst at ontko dot com)
|
|
4 " URL: http://www.ontko.com/sqr/#editor_config_files
|
|
5 "
|
|
6 " Modification History:
|
|
7 " 2002-Apr-12: Updated for SQR v6.x
|
|
8 " 2002-Jul-30: Added { and } to iskeyword definition
|
|
9 " 2003-Oct-15: Allow "." in variable names
|
|
10 " highlight entire open '... literal when it contains
|
|
11 " "''" inside it (e.g. "'I can''t say" is treated
|
|
12 " as one open string, not one terminated and one open)
|
|
13 " {} variables can occur inside of '...' literals
|
|
14 "
|
|
15 " Thanks to the previous maintainer of this file, Jeff Lanzarotta:
|
|
16 " http://lanzarotta.tripod.com/vim.html
|
|
17 " jefflanzarotta at yahoo dot com
|
|
18
|
|
19 " For version 5.x, clear all syntax items.
|
|
20 " For version 6.x, quit when a syntax file was already loaded.
|
|
21 if version < 600
|
|
22 syntax clear
|
|
23 elseif exists("b:current_syntax")
|
|
24 finish
|
|
25 endif
|
|
26
|
|
27 if version >= 600
|
|
28 setlocal iskeyword=@,48-57,_,-,#,$,{,}
|
|
29 else
|
|
30 set iskeyword=@,48-57,_,-,#,$,{,}
|
|
31 endif
|
|
32
|
|
33 syn case ignore
|
|
34
|
|
35 " BEGIN GENERATED SECTION ============================================
|
|
36
|
|
37 " Generated by generate_vim_syntax.sqr at 2002/04/11 13:04
|
|
38 " (based on the UltraEdit syntax file for SQR 6.1.4
|
|
39 " found at http://www.ontko.com/sqr/#editor_config_files )
|
|
40
|
|
41 syn keyword sqrSection begin-footing begin-heading begin-procedure
|
|
42 syn keyword sqrSection begin-program begin-report begin-setup
|
|
43 syn keyword sqrSection end-footing end-heading end-procedure
|
|
44 syn keyword sqrSection end-program end-report end-setup
|
|
45
|
|
46 syn keyword sqrParagraph alter-color-map alter-conection
|
|
47 syn keyword sqrParagraph alter-locale alter-printer alter-report
|
|
48 syn keyword sqrParagraph begin-document begin-execute begin-select
|
|
49 syn keyword sqrParagraph begin-sql declare-chart declare-image
|
|
50 syn keyword sqrParagraph declare-color-map declare-conection
|
|
51 syn keyword sqrParagraph declare-layout declare-printer
|
|
52 syn keyword sqrParagraph declare-report declare-procedure
|
|
53 syn keyword sqrParagraph declare-toc declare-variable end-declare
|
|
54 syn keyword sqrParagraph end-document end-select exit-select end-sql
|
|
55 syn keyword sqrParagraph load-lookup
|
|
56
|
|
57 syn keyword sqrReserved #current-column #current-date #current-line
|
|
58 syn keyword sqrReserved #end-file #page-count #return-status
|
|
59 syn keyword sqrReserved #sql-count #sql-status #sqr-max-columns
|
|
60 syn keyword sqrReserved #sqr-max-lines #sqr-pid #sqr-toc-level
|
|
61 syn keyword sqrReserved #sqr-toc-page $sqr-database {sqr-database}
|
|
62 syn keyword sqrReserved $sqr-dbcs {sqr-dbcs} $sqr-encoding
|
|
63 syn keyword sqrReserved {sqr-encoding} $sqr-encoding-console
|
|
64 syn keyword sqrReserved {sqr-encoding-console}
|
|
65 syn keyword sqrReserved $sqr-encoding-database
|
|
66 syn keyword sqrReserved {sqr-encoding-database}
|
|
67 syn keyword sqrReserved $sqr-encoding-file-input
|
|
68 syn keyword sqrReserved {sqr-encoding-file-input}
|
|
69 syn keyword sqrReserved $sqr-encoding-file-output
|
|
70 syn keyword sqrReserved {sqr-encoding-file-output}
|
|
71 syn keyword sqrReserved $sqr-encoding-report-input
|
|
72 syn keyword sqrReserved {sqr-encoding-report-input}
|
|
73 syn keyword sqrReserved $sqr-encoding-report-output
|
|
74 syn keyword sqrReserved {sqr-encoding-report-output}
|
|
75 syn keyword sqrReserved $sqr-encoding-source {sqr-encoding-source}
|
|
76 syn keyword sqrReserved $sql-error $sqr-hostname {sqr-hostname}
|
|
77 syn keyword sqrReserved $sqr-locale $sqr-platform {sqr-platform}
|
|
78 syn keyword sqrReserved $sqr-program $sqr-report $sqr-toc-text
|
|
79 syn keyword sqrReserved $sqr-ver $username
|
|
80
|
|
81 syn keyword sqrPreProc #define #else #end-if #endif #if #ifdef
|
|
82 syn keyword sqrPreProc #ifndef #include
|
|
83
|
|
84 syn keyword sqrCommand add array-add array-divide array-multiply
|
|
85 syn keyword sqrCommand array-subtract ask break call clear-array
|
|
86 syn keyword sqrCommand close columns commit concat connect
|
|
87 syn keyword sqrCommand create-array create-color-palette date-time
|
|
88 syn keyword sqrCommand display divide do dollar-symbol else encode
|
|
89 syn keyword sqrCommand end-evaluate end-if end-while evaluate
|
|
90 syn keyword sqrCommand execute extract find get get-color goto
|
|
91 syn keyword sqrCommand graphic if input last-page let lookup
|
|
92 syn keyword sqrCommand lowercase mbtosbs money-symbol move
|
|
93 syn keyword sqrCommand multiply new-page new-report next-column
|
|
94 syn keyword sqrCommand next-listing no-formfeed open page-number
|
|
95 syn keyword sqrCommand page-size position print print-bar-code
|
|
96 syn keyword sqrCommand print-chart print-direct print-image
|
|
97 syn keyword sqrCommand printer-deinit printer-init put read
|
|
98 syn keyword sqrCommand rollback security set-color set-delay-print
|
|
99 syn keyword sqrCommand set-generations set-levels set-members
|
|
100 syn keyword sqrCommand sbtombs show stop string subtract toc-entry
|
|
101 syn keyword sqrCommand unstring uppercase use use-column
|
|
102 syn keyword sqrCommand use-printer-type use-procedure use-report
|
|
103 syn keyword sqrCommand while write
|
|
104
|
|
105 syn keyword sqrParam 3d-effects after after-bold after-page
|
|
106 syn keyword sqrParam after-report after-toc and as at-end before
|
|
107 syn keyword sqrParam background batch-mode beep before-bold
|
|
108 syn keyword sqrParam before-page before-report before-toc blink
|
|
109 syn keyword sqrParam bold border bottom-margin box break by
|
|
110 syn keyword sqrParam caption center char char-size char-width
|
|
111 syn keyword sqrParam chars-inch chart-size checksum cl
|
|
112 syn keyword sqrParam clear-line clear-screen color color-palette
|
|
113 syn keyword sqrParam cs color_ data-array
|
|
114 syn keyword sqrParam data-array-column-count
|
|
115 syn keyword sqrParam data-array-column-labels
|
|
116 syn keyword sqrParam data-array-row-count data-labels date
|
|
117 syn keyword sqrParam date-edit-mask date-seperator
|
|
118 syn keyword sqrParam day-of-week-case day-of-week-full
|
|
119 syn keyword sqrParam day-of-week-short decimal decimal-seperator
|
|
120 syn keyword sqrParam default-numeric delay distinct dot-leader
|
|
121 syn keyword sqrParam edit-option-ad edit-option-am
|
|
122 syn keyword sqrParam edit-option-bc edit-option-na
|
|
123 syn keyword sqrParam edit-option-pm encoding entry erase-page
|
|
124 syn keyword sqrParam extent field fill fixed fixed_nolf float
|
|
125 syn keyword sqrParam font font-style font-type footing
|
|
126 syn keyword sqrParam footing-size foreground for-append
|
|
127 syn keyword sqrParam for-reading for-reports for-tocs
|
|
128 syn keyword sqrParam for-writing format formfeed from goto-top
|
|
129 syn keyword sqrParam group having heading heading-size height
|
|
130 syn keyword sqrParam horz-line image-size in indentation
|
|
131 syn keyword sqrParam init-string input-date-edit-mask insert
|
|
132 syn keyword sqrParam integer into item-color item-size key
|
|
133 syn keyword sqrParam layout left-margin legend legend-placement
|
|
134 syn keyword sqrParam legend-presentation legend-title level
|
|
135 syn keyword sqrParam line-height line-size line-width lines-inch
|
|
136 syn keyword sqrParam local locale loops max-columns max-lines
|
|
137 syn keyword sqrParam maxlen money money-edit-mask money-sign
|
|
138 syn keyword sqrParam money-sign-location months-case months-full
|
|
139 syn keyword sqrParam months-short name need newline newpage
|
|
140 syn keyword sqrParam no-advance nolf noline noprompt normal not
|
|
141 syn keyword sqrParam nowait number number-edit-mask on-break
|
|
142 syn keyword sqrParam on-error or order orientation page-depth
|
|
143 syn keyword sqrParam paper-size pie-segment-explode
|
|
144 syn keyword sqrParam pie-segment-percent-display
|
|
145 syn keyword sqrParam pie-segment-quantity-display pitch
|
|
146 syn keyword sqrParam point-markers point-size printer
|
|
147 syn keyword sqrParam printer-type quiet record reset-string
|
|
148 syn keyword sqrParam return_value reverse right-margin rows save
|
|
149 syn keyword sqrParam select size skip skiplines sort source
|
|
150 syn keyword sqrParam sqr-database sqr-platform startup-file
|
|
151 syn keyword sqrParam status stop sub-title symbol-set system
|
|
152 syn keyword sqrParam table text thousand-seperator
|
|
153 syn keyword sqrParam time-seperator times title to toc
|
|
154 syn keyword sqrParam top-margin type underline update using
|
|
155 syn keyword sqrParam value vary vert-line wait warn when
|
|
156 syn keyword sqrParam when-other where with x-axis-grid
|
|
157 syn keyword sqrParam x-axis-label x-axis-major-increment
|
|
158 syn keyword sqrParam x-axis-major-tick-marks x-axis-max-value
|
|
159 syn keyword sqrParam x-axis-min-value x-axis-minor-increment
|
|
160 syn keyword sqrParam x-axis-minor-tick-marks x-axis-rotate
|
|
161 syn keyword sqrParam x-axis-scale x-axis-tick-mark-placement xor
|
|
162 syn keyword sqrParam y-axis-grid y-axis-label
|
|
163 syn keyword sqrParam y-axis-major-increment
|
|
164 syn keyword sqrParam y-axis-major-tick-marks y-axis-max-value
|
|
165 syn keyword sqrParam y-axis-min-value y-axis-minor-increment
|
|
166 syn keyword sqrParam y-axis-minor-tick-marks y-axis-scale
|
|
167 syn keyword sqrParam y-axis-tick-mark-placement y2-type
|
|
168 syn keyword sqrParam y2-data-array y2-data-array-row-count
|
|
169 syn keyword sqrParam y2-data-array-column-count
|
|
170 syn keyword sqrParam y2-data-array-column-labels
|
|
171 syn keyword sqrParam y2-axis-color-palette y2-axis-label
|
|
172 syn keyword sqrParam y2-axis-major-increment
|
|
173 syn keyword sqrParam y2-axis-major-tick-marks y2-axis-max-value
|
|
174 syn keyword sqrParam y2-axis-min-value y2-axis-minor-increment
|
|
175 syn keyword sqrParam y2-axis-minor-tick-marks y2-axis-scale
|
|
176
|
|
177 syn keyword sqrFunction abs acos asin atan array ascii asciic ceil
|
|
178 syn keyword sqrFunction cos cosh chr cond deg delete dateadd
|
|
179 syn keyword sqrFunction datediff datenow datetostr e10 exp edit
|
|
180 syn keyword sqrFunction exists floor getenv instr instrb isblank
|
|
181 syn keyword sqrFunction isnull log log10 length lengthb lengthp
|
|
182 syn keyword sqrFunction lengtht lower lpad ltrim mod nvl power rad
|
|
183 syn keyword sqrFunction round range replace roman rpad rtrim rename
|
|
184 syn keyword sqrFunction sign sin sinh sqrt substr substrb substrp
|
|
185 syn keyword sqrFunction substrt strtodate tan tanh trunc to_char
|
|
186 syn keyword sqrFunction to_multi_byte to_number to_single_byte
|
|
187 syn keyword sqrFunction transform translate unicode upper wrapdepth
|
|
188
|
|
189 " END GENERATED SECTION ==============================================
|
|
190
|
|
191 " Variables
|
|
192 syn match sqrVariable /\(\$\|#\|&\)\(\k\|\.\)*/
|
|
193
|
|
194
|
|
195 " Debug compiler directives
|
|
196 syn match sqrPreProc /\s*#debug\a\=\(\s\|$\)/
|
|
197 syn match sqrSubstVar /{\k*}/
|
|
198
|
|
199
|
|
200 " Strings
|
|
201 " Note: if an undoubled ! is found, this is not a valid string
|
|
202 " (SQR will treat the end of the line as a comment)
|
|
203 syn match sqrString /'\(!!\|[^!']\)*'/ contains=sqrSubstVar
|
|
204 syn match sqrStrOpen /'\(!!\|''\|[^!']\)*$/
|
|
205 " If we find a ' followed by an unmatched ! before a matching ',
|
|
206 " flag the error.
|
|
207 syn match sqrError /'\(!!\|[^'!]\)*![^!]/me=e-1
|
|
208 syn match sqrError /'\(!!\|[^'!]\)*!$/
|
|
209
|
|
210 " Numbers:
|
|
211 syn match sqrNumber /-\=\<\d*\.\=[0-9_]\>/
|
|
212
|
|
213
|
|
214
|
|
215 " Comments:
|
|
216 " Handle comments that start with "!=" specially; they are only valid
|
|
217 " in the first column of the source line. Also, "!!" is only treated
|
|
218 " as a start-comment if there is only whitespace ahead of it on the line.
|
|
219
|
|
220 syn keyword sqrTodo TODO FIXME XXX DEBUG NOTE ###
|
|
221 syn match sqrTodo /???/
|
|
222
|
|
223 if version >= 600
|
|
224 " See also the sqrString section above for handling of ! characters
|
|
225 " inside of strings. (Those patterns override the ones below.)
|
|
226 syn match sqrComment /!\@<!!\([^!=].*\|$\)/ contains=sqrTodo
|
|
227 " the ! can't be preceeded by another !,
|
|
228 " and must be followed by at least one
|
|
229 " character other than ! or =, or immediately
|
|
230 " by the end-of-line
|
|
231 syn match sqrComment /^!=.*/ contains=sqrTodo
|
|
232 syn match sqrComment /^!!.*/ contains=sqrTodo
|
|
233 syn match sqrError /^\s\+\zs!=.*/
|
|
234 " it's an error to have "!=" preceeded by
|
|
235 " just whitespace on the line ("!="
|
|
236 " preceeded by non-whitespace is treated
|
|
237 " as neither a comment nor an error, since
|
|
238 " it is often correct, i.e.
|
|
239 " if #count != 7
|
|
240 syn match sqrError /.\+\zs!!.*/
|
|
241 " a "!!" anywhere but at the beginning of
|
|
242 " the line is always an error
|
|
243 else "For versions before 6.0, same idea as above but we are limited
|
|
244 "to simple patterns only. Also, the sqrString patterns above
|
|
245 "don't seem to take precedence in v5 as they do in v6, so
|
|
246 "we split the last rule to ignore comments found inside of
|
|
247 "string literals.
|
|
248 syn match sqrComment /!\([^!=].*\|$\)/ contains=sqrTodo
|
|
249 syn match sqrComment /^!=.*/ contains=sqrTodo
|
|
250 syn match sqrComment /^!!.*/ contains=sqrTodo
|
|
251 syn match sqrError /^\s\+!=.*/
|
|
252 syn match sqrError /^[^'!]\+!!/
|
|
253 " flag !! on lines that don't have ! or '
|
|
254 syn match sqrError /^\([^!']*'[^']*'[^!']*\)\+!!/
|
|
255 " flag !! found after matched ' ' chars
|
|
256 " (that aren't also commented)
|
|
257 endif
|
|
258
|
|
259
|
|
260 " Define the default highlighting.
|
|
261 " For version 5.7 and earlier, only when not done already.
|
|
262 " For version 5.8 and later, only when an item doesn;t have hightlighting yet.
|
|
263 if version >= 508 || !exists("did_sqr_syn_inits")
|
|
264 if version < 508
|
|
265 let did_sqr_syn_inits = 1
|
|
266 command -nargs=+ HiLink hi link <args>
|
|
267 else
|
|
268 command -nargs=+ HiLink hi def link <args>
|
|
269 endif
|
|
270
|
|
271 HiLink sqrSection Statement
|
|
272 HiLink sqrParagraph Statement
|
|
273 HiLink sqrReserved Statement
|
|
274 HiLink sqrParameter Statement
|
|
275 HiLink sqrPreProc PreProc
|
|
276 HiLink sqrSubstVar PreProc
|
|
277 HiLink sqrCommand Statement
|
|
278 HiLink sqrParam Type
|
|
279 HiLink sqrFunction Special
|
|
280
|
|
281 HiLink sqrString String
|
|
282 HiLink sqrStrOpen Todo
|
|
283 HiLink sqrNumber Number
|
|
284 HiLink sqrVariable Identifier
|
|
285
|
|
286 HiLink sqrComment Comment
|
|
287 HiLink sqrTodo Todo
|
|
288 HiLink sqrError Error
|
|
289
|
|
290 delcommand HiLink
|
|
291 endif
|
|
292
|
|
293 let b:current_syntax = "sqr"
|
|
294
|
|
295 " vim: ts=8 sw=2
|