Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file" |
| 2 | " Language: Baan |
| 3 | " Maintainer: Erwin Smit / Her van de Vliert |
| 4 | " Last change: 30-10-2001" |
| 5 | |
| 6 | " For version 5.x: Clear all syntax items |
| 7 | " For version 6.x: Quit when a syntax file was already loaded |
| 8 | if version < 600 |
| 9 | syntax clear |
| 10 | elseif exists("b:current_syntax") |
| 11 | finish |
| 12 | endif |
| 13 | |
| 14 | "************************************* 3GL ************************************" |
| 15 | syn match baan3gl "#ident" |
| 16 | syn match baan3gl "#include" |
| 17 | syn match baan3gl "#define" |
| 18 | syn match baan3gl "#undef" |
| 19 | syn match baan3gl "#pragma" |
| 20 | syn keyword baanConditional if then else case endif while endwhile endfor endcase |
| 21 | syn keyword baan3gl at based break bset call common const continue default double |
| 22 | syn keyword baan3gl empty extern fixed function ge global goto gt le lt mb |
| 23 | syn keyword baan3gl multibyte ne ofr prompt ref repeat static step stop string |
| 24 | syn keyword baan3gl true false until void wherebind |
| 25 | syn keyword baan3gl and or to not in |
| 26 | syn keyword baan3gl domain table eq input end long dim return at base print |
| 27 | syn match baan3gl "\<for\>" contains=baansql |
| 28 | syn match baan3gl "on case" |
| 29 | syn match baan3gl "e\=n\=d\=dllusage" |
| 30 | |
| 31 | "************************************* SQL ************************************" |
| 32 | syn keyword baansqlh where reference selecterror selectbind selectdo selectempty |
| 33 | syn keyword baansqlh selecteos whereused endselect unref setunref clearunref |
| 34 | syn keyword baansqlh from select clear skip rows |
| 35 | syn keyword baansql between inrange having |
| 36 | syn match baansql "as set with \d\+ rows" |
| 37 | syn match baansql "as prepared set" |
| 38 | syn match baansql "as prepared set with \d\+ rows" |
| 39 | syn match baansql "refers to" |
| 40 | syn match baansql "with retry" |
| 41 | syn match baansql "with retry repeat last row" |
| 42 | syn match baansql "for update" |
| 43 | syn match baansql "order by" |
| 44 | syn match baansql "group by" |
| 45 | syn match baansql "commit\.transaction()" |
| 46 | syn match baansql "abort\.transaction()" |
| 47 | syn match baansql "db\.columns\.to\.record" |
| 48 | syn match baansql "db\.record\.to\.columns" |
| 49 | syn match baansql "db\.bind" |
| 50 | syn match baansql "db\.change\.order" |
| 51 | syn match baansql "\<db\.eq" |
| 52 | syn match baansql "\<db\.first" |
| 53 | syn match baansql "\<db\.gt" |
| 54 | syn match baansql "\<db\.ge" |
| 55 | syn match baansql "\<db\.le" |
| 56 | syn match baansql "\<db\.next" |
| 57 | syn match baansql "\<db\.prev" |
| 58 | syn match baansql "\<db\.insert" |
| 59 | syn match baansql "\<db\.delete" |
| 60 | syn match baansql "\<db\.update" |
| 61 | syn match baansql "\<db\.create\.table" |
| 62 | syn match baansql "db\.set\.to\.default" |
| 63 | syn match baansql "db\.retry" |
| 64 | syn match baansql "DB\.RETRY" |
| 65 | syn match baansql "db\.delayed\.lock" |
| 66 | syn match baansql "db\.retry\.point()" |
| 67 | syn match baansql "db\.retry\.hit()" |
| 68 | syn match baansql "db\.return\.dupl" |
| 69 | syn match baansql "db\.skip\.dupl" |
| 70 | syn match baansql "db\.row\.length" |
| 71 | |
| 72 | "************************************* 4GL ************************************" |
| 73 | " Program section |
| 74 | syn match baan4glh "declaration:" |
| 75 | syn match baan4glh "functions:" |
| 76 | syn match baan4glh "before\.program:" |
| 77 | syn match baan4glh "on\.error:" |
| 78 | syn match baan4glh "after\.program:" |
| 79 | syn match baan4glh "after\.update.db.commit:" |
| 80 | syn match baan4glh "before\.display\.object:" |
| 81 | |
| 82 | " Form section |
| 83 | syn match baan4glh "form\.\d\+:" |
| 84 | syn match baan4glh "form\.all:" |
| 85 | syn match baan4glh "form\.other:" |
| 86 | syn match baan4gl "init\.form:" |
| 87 | syn match baan4gl "before\.form:" |
| 88 | syn match baan4gl "after\.form:" |
| 89 | |
| 90 | " Choice section |
| 91 | syn match baan4glh "choice\.start\.set:" |
| 92 | syn match baan4glh "choice\.first\.view:" |
| 93 | syn match baan4glh "choice\.next\.view:" |
| 94 | syn match baan4glh "choice\.prev\.view:" |
| 95 | syn match baan4glh "choice\.last\.view:" |
| 96 | syn match baan4glh "choice\.def\.find:" |
| 97 | syn match baan4glh "choice\.find\.data:" |
| 98 | syn match baan4glh "choice\.first\.set:" |
| 99 | syn match baan4glh "choice\.next\.set:" |
| 100 | syn match baan4glh "choice\.display\.set:" |
| 101 | syn match baan4glh "choice\.prev\.set:" |
| 102 | syn match baan4glh "choice\.rotate\.curr:" |
| 103 | syn match baan4glh "choice\.last\.set:" |
| 104 | syn match baan4glh "choice\.add\.set:" |
| 105 | syn match baan4glh "choice\.update\.db:" |
| 106 | syn match baan4glh "choice\.dupl\.occur:" |
| 107 | syn match baan4glh "choice\.recover\.set:" |
| 108 | syn match baan4glh "choice\.mark\.delete:" |
| 109 | syn match baan4glh "choice\.mark\.occur:" |
| 110 | syn match baan4glh "choice\.change\.order:" |
| 111 | syn match baan4glh "choice\.modify\.set:" |
| 112 | syn match baan4glh "choice\.restart\.input:" |
| 113 | syn match baan4glh "choice\.print\.data:" |
| 114 | syn match baan4glh "choice\.create\.job:" |
| 115 | syn match baan4glh "choice\.form\.tab\.change:" |
| 116 | syn match baan4glh "choice\.first\.frm:" |
| 117 | syn match baan4glh "choice\.next\.frm:" |
| 118 | syn match baan4glh "choice\.prev\.frm:" |
| 119 | syn match baan4glh "choice\.last\.frm:" |
| 120 | syn match baan4glh "choice\.resize\.frm:" |
| 121 | syn match baan4glh "choice\.cmd\.options:" |
| 122 | syn match baan4glh "choice\.zoom:" |
| 123 | syn match baan4glh "choice\.interrupt:" |
| 124 | syn match baan4glh "choice\.end\.program:" |
| 125 | syn match baan4glh "choice\.abort\.program:" |
| 126 | syn match baan4glh "choice\.cont\.process:" |
| 127 | syn match baan4glh "choice\.text\.manager:" |
| 128 | syn match baan4glh "choice\.run\.job:" |
| 129 | syn match baan4glh "choice\.global\.delete:" |
| 130 | syn match baan4glh "choice\.global\.copy:" |
| 131 | syn match baan4glh "choice\.save\.defaults" |
| 132 | syn match baan4glh "choice\.get\.defaults:" |
| 133 | syn match baan4glh "choice\.start\.chart:" |
| 134 | syn match baan4glh "choice\.start\.query:" |
| 135 | syn match baan4glh "choice\.user\.\d:" |
| 136 | syn match baan4glh "choice\.ask\.helpinfo:" |
| 137 | syn match baan4glh "choice\.calculator:" |
| 138 | syn match baan4glh "choice\.calendar:" |
| 139 | syn match baan4glh "choice\.bms:" |
| 140 | syn match baan4glh "choice\.cmd\.whats\.this:" |
| 141 | syn match baan4glh "choice\.help\.index:" |
| 142 | syn match baan4gl "before\.choice:" |
| 143 | syn match baan4gl "on\.choice:" |
| 144 | syn match baan4gl "after\.choice:" |
| 145 | |
| 146 | " Field section |
| 147 | syn match baan4glh "field\.\l\{5}\d\{3}\.\l\{4}\.\=c\=:" |
| 148 | syn match baan4glh "field\.e\..\+:" |
| 149 | syn match baan4glh "field\.all:" |
| 150 | syn match baan4glh "field\.other:" |
| 151 | syn match baan4gl "init\.field:" |
| 152 | syn match baan4gl "before\.field:" |
| 153 | syn match baan4gl "before\.input:" |
| 154 | syn match baan4gl "before\.display:" |
| 155 | syn match baan4gl "before\.zoom:" |
| 156 | syn match baan4gl "before\.checks:" |
| 157 | syn match baan4gl "domain\.error:" |
| 158 | syn match baan4gl "ref\.input:" |
| 159 | syn match baan4gl "ref\.display:" |
| 160 | syn match baan4gl "check\.input:" |
| 161 | syn match baan4gl "on\.input:" |
| 162 | syn match baan4gl "when\.field\.changes:" |
| 163 | syn match baan4gl "after\.zoom:" |
| 164 | syn match baan4gl "after\.input:" |
| 165 | syn match baan4gl "after\.display:" |
| 166 | syn match baan4gl "after\.field:" |
| 167 | |
| 168 | " Group section |
| 169 | syn match baan4glh "group\.\d\+:" |
| 170 | syn match baan4gl "init\.group:" |
| 171 | syn match baan4gl "before\.group:" |
| 172 | syn match baan4gl "after\.group:" |
| 173 | |
| 174 | " Zoom section |
| 175 | syn match baan4glh "zoom\.from\..\+:" |
| 176 | syn match baan4gl "on\.entry:" |
| 177 | syn match baan4gl "on\.exit:" |
| 178 | " Main table section |
| 179 | syn match baan4glh "main\.table\.io:" |
| 180 | syn match baan4gl "before\.read:" |
| 181 | syn match baan4gl "after\.read:" |
| 182 | syn match baan4gl "before\.write:" |
| 183 | syn match baan4gl "after\.write:" |
| 184 | syn match baan4gl "after\.skip\.write:" |
| 185 | syn match baan4gl "before\.rewrite:" |
| 186 | syn match baan4gl "after\.rewrite:" |
| 187 | syn match baan4gl "after\.skip\.rewrite:" |
| 188 | syn match baan4gl "before\.delete:" |
| 189 | syn match baan4gl "after\.delete:" |
| 190 | syn match baan4gl "after\.skip\.delete:" |
| 191 | syn match baan4gl "read\.view:" |
| 192 | |
| 193 | "number without a dot." |
| 194 | syn match baanNumber "\<\-\=\d\+\>" |
| 195 | "number with dot" |
| 196 | syn match baanNumber "\<\-\=\d\+\.\d*\>" |
| 197 | "number starting with a dot" |
| 198 | syn match baanNumber "\<\-\=\.\d\+\>" |
| 199 | |
| 200 | " String" |
| 201 | syn region baanString start=+"+ skip=+""+ end=+"+ |
| 202 | " Comment" |
| 203 | syn match baanComment "|$" |
| 204 | syn match baanComment "|.$" |
| 205 | syn match baanComment "|[^ ]" |
| 206 | syn match baanComment "|[^#].*[^ ]" |
| 207 | syn match baanCommenth "^|#lra.*$" |
| 208 | syn match baanCommenth "^|#mdm.*$" |
| 209 | syn match baanCommenth "^|#[0-9][0-9][0-9][0-9][0-9].*$" |
| 210 | syn match baanCommenth "^|#N\=o\=Include.*$" |
| 211 | syn region baanComment start="dllusage" end="enddllusage" |
| 212 | " Oldcode" |
| 213 | syn match baanUncommented "^|[^*#].*[^ ]" |
| 214 | " SpaceError" |
| 215 | syn match BaanSpaces " " |
| 216 | syn match baanSpaceError "\s*$" |
| 217 | syn match baanSpaceError " " |
| 218 | |
| 219 | " Define the default highlighting. |
| 220 | " For version 5.7 and earlier: only when not done already |
| 221 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 222 | if version >= 508 || !exists("did_baan_syn_inits") |
| 223 | if version < 508 |
| 224 | let did_c_syn_inits = 1 |
| 225 | command -nargs=+ HiLink hi link <args> |
| 226 | else |
| 227 | command -nargs=+ HiLink hi def link <args> |
| 228 | endif |
| 229 | |
| 230 | HiLink baanConditional Conditional |
| 231 | HiLink baan3gl Statement |
| 232 | HiLink baan4gl Statement |
| 233 | HiLink baan4glh Statement |
| 234 | HiLink baansql Statement |
| 235 | HiLink baansqlh Statement |
| 236 | HiLink baanNumber Number |
| 237 | HiLink baanString String |
| 238 | HiLink baanComment Comment |
| 239 | HiLink baanCommenth Comment |
| 240 | HiLink baanUncommented Comment |
| 241 | |
| 242 | delcommand HiLink |
| 243 | endif |
| 244 | |
| 245 | let b:current_syntax = "baan" |
| 246 | |
| 247 | " vim: ts=8 |