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