blob: 8c9e7b49e473d250acb252fec514ae8c48eeb6c9 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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.
21if version < 600
22 syntax clear
23elseif exists("b:current_syntax")
24 finish
25endif
26
27if version >= 600
28 setlocal iskeyword=@,48-57,_,-,#,$,{,}
29else
30 set iskeyword=@,48-57,_,-,#,$,{,}
31endif
32
33syn 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
41syn keyword sqrSection begin-footing begin-heading begin-procedure
42syn keyword sqrSection begin-program begin-report begin-setup
43syn keyword sqrSection end-footing end-heading end-procedure
44syn keyword sqrSection end-program end-report end-setup
45
Bram Moolenaar15146672011-10-20 22:22:38 +020046syn keyword sqrParagraph alter-color-map alter-connection
Bram Moolenaar071d4272004-06-13 20:20:40 +000047syn keyword sqrParagraph alter-locale alter-printer alter-report
48syn keyword sqrParagraph begin-document begin-execute begin-select
49syn keyword sqrParagraph begin-sql declare-chart declare-image
Bram Moolenaar15146672011-10-20 22:22:38 +020050syn keyword sqrParagraph declare-color-map declare-connection
Bram Moolenaar071d4272004-06-13 20:20:40 +000051syn keyword sqrParagraph declare-layout declare-printer
52syn keyword sqrParagraph declare-report declare-procedure
53syn keyword sqrParagraph declare-toc declare-variable end-declare
54syn keyword sqrParagraph end-document end-select exit-select end-sql
55syn keyword sqrParagraph load-lookup
56
57syn keyword sqrReserved #current-column #current-date #current-line
58syn keyword sqrReserved #end-file #page-count #return-status
59syn keyword sqrReserved #sql-count #sql-status #sqr-max-columns
60syn keyword sqrReserved #sqr-max-lines #sqr-pid #sqr-toc-level
61syn keyword sqrReserved #sqr-toc-page $sqr-database {sqr-database}
62syn keyword sqrReserved $sqr-dbcs {sqr-dbcs} $sqr-encoding
63syn keyword sqrReserved {sqr-encoding} $sqr-encoding-console
64syn keyword sqrReserved {sqr-encoding-console}
65syn keyword sqrReserved $sqr-encoding-database
66syn keyword sqrReserved {sqr-encoding-database}
67syn keyword sqrReserved $sqr-encoding-file-input
68syn keyword sqrReserved {sqr-encoding-file-input}
69syn keyword sqrReserved $sqr-encoding-file-output
70syn keyword sqrReserved {sqr-encoding-file-output}
71syn keyword sqrReserved $sqr-encoding-report-input
72syn keyword sqrReserved {sqr-encoding-report-input}
73syn keyword sqrReserved $sqr-encoding-report-output
74syn keyword sqrReserved {sqr-encoding-report-output}
75syn keyword sqrReserved $sqr-encoding-source {sqr-encoding-source}
76syn keyword sqrReserved $sql-error $sqr-hostname {sqr-hostname}
77syn keyword sqrReserved $sqr-locale $sqr-platform {sqr-platform}
78syn keyword sqrReserved $sqr-program $sqr-report $sqr-toc-text
79syn keyword sqrReserved $sqr-ver $username
80
81syn keyword sqrPreProc #define #else #end-if #endif #if #ifdef
82syn keyword sqrPreProc #ifndef #include
83
84syn keyword sqrCommand add array-add array-divide array-multiply
85syn keyword sqrCommand array-subtract ask break call clear-array
86syn keyword sqrCommand close columns commit concat connect
87syn keyword sqrCommand create-array create-color-palette date-time
88syn keyword sqrCommand display divide do dollar-symbol else encode
89syn keyword sqrCommand end-evaluate end-if end-while evaluate
90syn keyword sqrCommand execute extract find get get-color goto
91syn keyword sqrCommand graphic if input last-page let lookup
92syn keyword sqrCommand lowercase mbtosbs money-symbol move
93syn keyword sqrCommand multiply new-page new-report next-column
94syn keyword sqrCommand next-listing no-formfeed open page-number
95syn keyword sqrCommand page-size position print print-bar-code
96syn keyword sqrCommand print-chart print-direct print-image
97syn keyword sqrCommand printer-deinit printer-init put read
98syn keyword sqrCommand rollback security set-color set-delay-print
99syn keyword sqrCommand set-generations set-levels set-members
100syn keyword sqrCommand sbtombs show stop string subtract toc-entry
101syn keyword sqrCommand unstring uppercase use use-column
102syn keyword sqrCommand use-printer-type use-procedure use-report
103syn keyword sqrCommand while write
104
105syn keyword sqrParam 3d-effects after after-bold after-page
106syn keyword sqrParam after-report after-toc and as at-end before
107syn keyword sqrParam background batch-mode beep before-bold
108syn keyword sqrParam before-page before-report before-toc blink
109syn keyword sqrParam bold border bottom-margin box break by
110syn keyword sqrParam caption center char char-size char-width
111syn keyword sqrParam chars-inch chart-size checksum cl
112syn keyword sqrParam clear-line clear-screen color color-palette
113syn keyword sqrParam cs color_ data-array
114syn keyword sqrParam data-array-column-count
115syn keyword sqrParam data-array-column-labels
116syn keyword sqrParam data-array-row-count data-labels date
117syn keyword sqrParam date-edit-mask date-seperator
118syn keyword sqrParam day-of-week-case day-of-week-full
119syn keyword sqrParam day-of-week-short decimal decimal-seperator
120syn keyword sqrParam default-numeric delay distinct dot-leader
121syn keyword sqrParam edit-option-ad edit-option-am
122syn keyword sqrParam edit-option-bc edit-option-na
123syn keyword sqrParam edit-option-pm encoding entry erase-page
124syn keyword sqrParam extent field fill fixed fixed_nolf float
125syn keyword sqrParam font font-style font-type footing
126syn keyword sqrParam footing-size foreground for-append
127syn keyword sqrParam for-reading for-reports for-tocs
128syn keyword sqrParam for-writing format formfeed from goto-top
129syn keyword sqrParam group having heading heading-size height
130syn keyword sqrParam horz-line image-size in indentation
131syn keyword sqrParam init-string input-date-edit-mask insert
132syn keyword sqrParam integer into item-color item-size key
133syn keyword sqrParam layout left-margin legend legend-placement
134syn keyword sqrParam legend-presentation legend-title level
135syn keyword sqrParam line-height line-size line-width lines-inch
136syn keyword sqrParam local locale loops max-columns max-lines
137syn keyword sqrParam maxlen money money-edit-mask money-sign
138syn keyword sqrParam money-sign-location months-case months-full
139syn keyword sqrParam months-short name need newline newpage
140syn keyword sqrParam no-advance nolf noline noprompt normal not
141syn keyword sqrParam nowait number number-edit-mask on-break
142syn keyword sqrParam on-error or order orientation page-depth
143syn keyword sqrParam paper-size pie-segment-explode
144syn keyword sqrParam pie-segment-percent-display
145syn keyword sqrParam pie-segment-quantity-display pitch
146syn keyword sqrParam point-markers point-size printer
147syn keyword sqrParam printer-type quiet record reset-string
148syn keyword sqrParam return_value reverse right-margin rows save
149syn keyword sqrParam select size skip skiplines sort source
150syn keyword sqrParam sqr-database sqr-platform startup-file
151syn keyword sqrParam status stop sub-title symbol-set system
152syn keyword sqrParam table text thousand-seperator
153syn keyword sqrParam time-seperator times title to toc
154syn keyword sqrParam top-margin type underline update using
155syn keyword sqrParam value vary vert-line wait warn when
156syn keyword sqrParam when-other where with x-axis-grid
157syn keyword sqrParam x-axis-label x-axis-major-increment
158syn keyword sqrParam x-axis-major-tick-marks x-axis-max-value
159syn keyword sqrParam x-axis-min-value x-axis-minor-increment
160syn keyword sqrParam x-axis-minor-tick-marks x-axis-rotate
161syn keyword sqrParam x-axis-scale x-axis-tick-mark-placement xor
162syn keyword sqrParam y-axis-grid y-axis-label
163syn keyword sqrParam y-axis-major-increment
164syn keyword sqrParam y-axis-major-tick-marks y-axis-max-value
165syn keyword sqrParam y-axis-min-value y-axis-minor-increment
166syn keyword sqrParam y-axis-minor-tick-marks y-axis-scale
167syn keyword sqrParam y-axis-tick-mark-placement y2-type
168syn keyword sqrParam y2-data-array y2-data-array-row-count
169syn keyword sqrParam y2-data-array-column-count
170syn keyword sqrParam y2-data-array-column-labels
171syn keyword sqrParam y2-axis-color-palette y2-axis-label
172syn keyword sqrParam y2-axis-major-increment
173syn keyword sqrParam y2-axis-major-tick-marks y2-axis-max-value
174syn keyword sqrParam y2-axis-min-value y2-axis-minor-increment
175syn keyword sqrParam y2-axis-minor-tick-marks y2-axis-scale
176
177syn keyword sqrFunction abs acos asin atan array ascii asciic ceil
178syn keyword sqrFunction cos cosh chr cond deg delete dateadd
179syn keyword sqrFunction datediff datenow datetostr e10 exp edit
180syn keyword sqrFunction exists floor getenv instr instrb isblank
181syn keyword sqrFunction isnull log log10 length lengthb lengthp
182syn keyword sqrFunction lengtht lower lpad ltrim mod nvl power rad
183syn keyword sqrFunction round range replace roman rpad rtrim rename
184syn keyword sqrFunction sign sin sinh sqrt substr substrb substrp
185syn keyword sqrFunction substrt strtodate tan tanh trunc to_char
186syn keyword sqrFunction to_multi_byte to_number to_single_byte
187syn keyword sqrFunction transform translate unicode upper wrapdepth
188
189" END GENERATED SECTION ==============================================
190
191" Variables
192syn match sqrVariable /\(\$\|#\|&\)\(\k\|\.\)*/
193
194
195" Debug compiler directives
196syn match sqrPreProc /\s*#debug\a\=\(\s\|$\)/
197syn 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)
203syn match sqrString /'\(!!\|[^!']\)*'/ contains=sqrSubstVar
204syn match sqrStrOpen /'\(!!\|''\|[^!']\)*$/
205" If we find a ' followed by an unmatched ! before a matching ',
206" flag the error.
207syn match sqrError /'\(!!\|[^'!]\)*![^!]/me=e-1
208syn match sqrError /'\(!!\|[^'!]\)*!$/
209
210" Numbers:
211syn 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
220syn keyword sqrTodo TODO FIXME XXX DEBUG NOTE ###
221syn match sqrTodo /???/
222
223if 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
Bram Moolenaar15146672011-10-20 22:22:38 +0200227 " the ! can't be preceded by another !,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228 " 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!=.*/
Bram Moolenaar15146672011-10-20 22:22:38 +0200234 " it's an error to have "!=" preceded by
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235 " just whitespace on the line ("!="
Bram Moolenaar15146672011-10-20 22:22:38 +0200236 " preceded by non-whitespace is treated
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237 " 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
243else "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)
257endif
258
259
260" Define the default highlighting.
261" For version 5.7 and earlier, only when not done already.
Bram Moolenaar15146672011-10-20 22:22:38 +0200262" For version 5.8 and later, only when an item doesn't have highlighting yet.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000263if 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
291endif
292
293let b:current_syntax = "sqr"
294
295" vim: ts=8 sw=2