sqr.vim 13 KB

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