Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 2 | " Maintainer: Christian Brabandt <cb@256bit.org> |
| 3 | " Previous Maintainer: Nikolai Weibull <now@bitwi.se> |
Christian Brabandt | 4aa6b52 | 2024-07-20 12:20:51 +0200 | [diff] [blame] | 4 | " Latest Revision: 2024-07-19 |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 5 | " License: Vim (see :h license) |
| 6 | " Repository: https://github.com/chrisbra/vim-kconfig |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 7 | |
| 8 | if exists("b:current_syntax") |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | let s:cpo_save = &cpo |
| 13 | set cpo&vim |
| 14 | |
| 15 | if exists("g:kconfig_syntax_heavy") |
| 16 | |
| 17 | syn match kconfigBegin '^' nextgroup=kconfigKeyword |
| 18 | \ skipwhite |
| 19 | |
| 20 | syn keyword kconfigTodo contained TODO FIXME XXX NOTE |
| 21 | |
| 22 | syn match kconfigComment display '#.*$' contains=kconfigTodo |
| 23 | |
| 24 | syn keyword kconfigKeyword config nextgroup=kconfigSymbol |
| 25 | \ skipwhite |
| 26 | |
| 27 | syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol |
| 28 | \ skipwhite |
| 29 | |
| 30 | syn keyword kconfigKeyword comment menu mainmenu |
| 31 | \ nextgroup=kconfigKeywordPrompt |
| 32 | \ skipwhite |
| 33 | |
| 34 | syn keyword kconfigKeyword choice |
| 35 | \ nextgroup=@kconfigConfigOptions |
| 36 | \ skipwhite skipnl |
| 37 | |
| 38 | syn keyword kconfigKeyword endmenu endchoice |
| 39 | |
| 40 | syn keyword kconfigPreProc source |
| 41 | \ nextgroup=kconfigPath |
| 42 | \ skipwhite |
| 43 | |
| 44 | " TODO: This is a hack. The who .*Expr stuff should really be generated so |
| 45 | " that we can reuse it for various nextgroups. |
| 46 | syn keyword kconfigConditional if endif |
| 47 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 48 | \ skipwhite |
| 49 | |
| 50 | syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 51 | \ contained |
| 52 | \ nextgroup=@kconfigConfigOptions |
| 53 | \ skipwhite skipnl |
| 54 | |
| 55 | syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' |
| 56 | \ contained |
| 57 | |
| 58 | syn match kconfigSymbol '\<\k\+\>' |
| 59 | \ contained |
| 60 | \ nextgroup=@kconfigConfigOptions |
| 61 | \ skipwhite skipnl |
| 62 | |
| 63 | " FIXME: There is – probably – no reason to cluster these instead of just |
| 64 | " defining them in the same group. |
| 65 | syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, |
| 66 | \ kconfigInputPrompt, |
| 67 | \ kconfigDefaultValue, |
| 68 | \ kconfigDependencies, |
| 69 | \ kconfigReverseDependencies, |
| 70 | \ kconfigNumericalRanges, |
| 71 | \ kconfigHelpText, |
| 72 | \ kconfigDefBool, |
| 73 | \ kconfigOptional |
| 74 | |
| 75 | syn keyword kconfigTypeDefinition bool boolean tristate string hex int |
| 76 | \ contained |
| 77 | \ nextgroup=kconfigTypeDefPrompt, |
| 78 | \ @kconfigConfigOptions |
| 79 | \ skipwhite skipnl |
| 80 | |
| 81 | syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 82 | \ contained |
| 83 | \ nextgroup=kconfigConfigOptionIf, |
| 84 | \ @kconfigConfigOptions |
| 85 | \ skipwhite skipnl |
| 86 | |
| 87 | syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 88 | \ contained |
| 89 | \ nextgroup=kconfigConfigOptionIf, |
| 90 | \ @kconfigConfigOptions |
| 91 | \ skipwhite skipnl |
| 92 | |
| 93 | syn keyword kconfigInputPrompt prompt |
| 94 | \ contained |
| 95 | \ nextgroup=kconfigPromptPrompt |
| 96 | \ skipwhite |
| 97 | |
| 98 | syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 99 | \ contained |
| 100 | \ nextgroup=kconfigConfigOptionIf, |
| 101 | \ @kconfigConfigOptions |
| 102 | \ skipwhite skipnl |
| 103 | |
| 104 | syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 105 | \ contained |
| 106 | \ nextgroup=kconfigConfigOptionIf, |
| 107 | \ @kconfigConfigOptions |
| 108 | \ skipwhite skipnl |
| 109 | |
| 110 | syn keyword kconfigDefaultValue default |
| 111 | \ contained |
| 112 | \ nextgroup=@kconfigConfigOptionExpr |
| 113 | \ skipwhite |
| 114 | |
| 115 | syn match kconfigDependencies 'depends on\|requires' |
| 116 | \ contained |
| 117 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 118 | \ skipwhite |
| 119 | |
| 120 | syn keyword kconfigReverseDependencies select |
| 121 | \ contained |
| 122 | \ nextgroup=@kconfigRevDepSymbol |
| 123 | \ skipwhite |
| 124 | |
| 125 | syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, |
| 126 | \ kconfigRevDepNCSymbol |
| 127 | |
| 128 | syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 129 | \ contained |
| 130 | \ nextgroup=kconfigConfigOptionIf, |
| 131 | \ @kconfigConfigOptions |
| 132 | \ skipwhite skipnl |
| 133 | |
| 134 | syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 135 | \ contained |
| 136 | \ nextgroup=kconfigConfigOptionIf, |
| 137 | \ @kconfigConfigOptions |
| 138 | \ skipwhite skipnl |
| 139 | |
| 140 | syn match kconfigRevDepNCSymbol '\<\k\+\>' |
| 141 | \ contained |
| 142 | \ nextgroup=kconfigConfigOptionIf, |
| 143 | \ @kconfigConfigOptions |
| 144 | \ skipwhite skipnl |
| 145 | |
| 146 | syn keyword kconfigNumericalRanges range |
| 147 | \ contained |
| 148 | \ nextgroup=@kconfigRangeSymbol |
| 149 | \ skipwhite |
| 150 | |
| 151 | syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, |
| 152 | \ kconfigRangeNCSymbol |
| 153 | |
| 154 | syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 155 | \ contained |
| 156 | \ nextgroup=@kconfigRangeSymbol2 |
| 157 | \ skipwhite skipnl |
| 158 | |
| 159 | syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 160 | \ contained |
| 161 | \ nextgroup=@kconfigRangeSymbol2 |
| 162 | \ skipwhite skipnl |
| 163 | |
| 164 | syn match kconfigRangeNCSymbol '\<\k\+\>' |
| 165 | \ contained |
| 166 | \ nextgroup=@kconfigRangeSymbol2 |
| 167 | \ skipwhite skipnl |
| 168 | |
| 169 | syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, |
| 170 | \ kconfigRangeNCSymbol2 |
| 171 | |
| 172 | syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 173 | \ contained |
| 174 | \ nextgroup=kconfigConfigOptionIf, |
| 175 | \ @kconfigConfigOptions |
| 176 | \ skipwhite skipnl |
| 177 | |
| 178 | syn match kconfigRangeNCSymbol2 '\<\k\+\>' |
| 179 | \ contained |
| 180 | \ nextgroup=kconfigConfigOptionIf, |
| 181 | \ @kconfigConfigOptions |
| 182 | \ skipwhite skipnl |
| 183 | |
| 184 | syn region kconfigHelpText contained |
| 185 | \ matchgroup=kconfigConfigOption |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 186 | \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 187 | \ skip='^$' |
| 188 | \ end='^\z1\@!' |
| 189 | \ nextgroup=@kconfigConfigOptions |
| 190 | \ skipwhite skipnl |
| 191 | |
| 192 | " XXX: Undocumented |
| 193 | syn keyword kconfigDefBool def_bool |
| 194 | \ contained |
| 195 | \ nextgroup=@kconfigDefBoolSymbol |
| 196 | \ skipwhite |
| 197 | |
| 198 | syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, |
| 199 | \ kconfigDefBoolNCSymbol |
| 200 | |
| 201 | syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 202 | \ contained |
| 203 | \ nextgroup=kconfigConfigOptionIf, |
| 204 | \ @kconfigConfigOptions |
| 205 | \ skipwhite skipnl |
| 206 | |
| 207 | syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 208 | \ contained |
| 209 | \ nextgroup=kconfigConfigOptionIf, |
| 210 | \ @kconfigConfigOptions |
| 211 | \ skipwhite skipnl |
| 212 | |
| 213 | syn match kconfigDefBoolNCSymbol '\<\k\+\>' |
| 214 | \ contained |
| 215 | \ nextgroup=kconfigConfigOptionIf, |
| 216 | \ @kconfigConfigOptions |
| 217 | \ skipwhite skipnl |
| 218 | |
| 219 | " XXX: This is actually only a valid option for “choice”, but treating it |
| 220 | " specially would require a lot of extra groups. |
| 221 | syn keyword kconfigOptional optional |
| 222 | \ contained |
| 223 | \ nextgroup=@kconfigConfigOptions |
| 224 | \ skipwhite skipnl |
| 225 | |
| 226 | syn keyword kconfigConfigOptionIf if |
| 227 | \ contained |
| 228 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 229 | \ skipwhite |
| 230 | |
| 231 | syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, |
| 232 | \ kconfigConfOptIfExprNeg, |
| 233 | \ kconfigConfOptIfExprGroup |
| 234 | |
| 235 | syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, |
| 236 | \ kconfigConfOptIfExprNCSym |
| 237 | |
| 238 | syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 239 | \ contained |
| 240 | \ nextgroup=@kconfigConfigOptions, |
| 241 | \ kconfigConfOptIfExprAnd, |
| 242 | \ kconfigConfOptIfExprOr, |
| 243 | \ kconfigConfOptIfExprEq, |
| 244 | \ kconfigConfOptIfExprNEq |
| 245 | \ skipwhite skipnl |
| 246 | |
| 247 | syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 248 | \ contained |
| 249 | \ nextgroup=@kconfigConfigOptions, |
| 250 | \ kconfigConfOptIfExprAnd, |
| 251 | \ kconfigConfOptIfExprOr, |
| 252 | \ kconfigConfOptIfExprEq, |
| 253 | \ kconfigConfOptIfExprNEq |
| 254 | \ skipwhite skipnl |
| 255 | |
| 256 | syn match kconfigConfOptIfExprNCSym '\<\k\+\>' |
| 257 | \ contained |
| 258 | \ nextgroup=@kconfigConfigOptions, |
| 259 | \ kconfigConfOptIfExprAnd, |
| 260 | \ kconfigConfOptIfExprOr, |
| 261 | \ kconfigConfOptIfExprEq, |
| 262 | \ kconfigConfOptIfExprNEq |
| 263 | \ skipwhite skipnl |
| 264 | |
| 265 | syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, |
| 266 | \ kconfigConfOptIfExprNCSym2 |
| 267 | |
| 268 | syn match kconfigConfOptIfExprEq '=' |
| 269 | \ contained |
| 270 | \ nextgroup=@kconfigConfOptIfExprSym2 |
| 271 | \ skipwhite |
| 272 | |
| 273 | syn match kconfigConfOptIfExprNEq '!=' |
| 274 | \ contained |
| 275 | \ nextgroup=@kconfigConfOptIfExprSym2 |
| 276 | \ skipwhite |
| 277 | |
| 278 | syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 279 | \ contained |
| 280 | \ nextgroup=@kconfigConfigOptions, |
| 281 | \ kconfigConfOptIfExprAnd, |
| 282 | \ kconfigConfOptIfExprOr |
| 283 | \ skipwhite skipnl |
| 284 | |
| 285 | syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' |
| 286 | \ contained |
| 287 | \ nextgroup=@kconfigConfigOptions, |
| 288 | \ kconfigConfOptIfExprAnd, |
| 289 | \ kconfigConfOptIfExprOr |
| 290 | \ skipwhite skipnl |
| 291 | |
| 292 | syn match kconfigConfOptIfExprNeg '!' |
| 293 | \ contained |
| 294 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 295 | \ skipwhite |
| 296 | |
| 297 | syn match kconfigConfOptIfExprAnd '&&' |
| 298 | \ contained |
| 299 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 300 | \ skipwhite |
| 301 | |
| 302 | syn match kconfigConfOptIfExprOr '||' |
| 303 | \ contained |
| 304 | \ nextgroup=@kconfigConfigOptionIfExpr |
| 305 | \ skipwhite |
| 306 | |
| 307 | syn match kconfigConfOptIfExprGroup '(' |
| 308 | \ contained |
| 309 | \ nextgroup=@kconfigConfigOptionIfGExp |
| 310 | \ skipwhite |
| 311 | |
| 312 | " TODO: hm, this kind of recursion doesn't work right. We need another set of |
| 313 | " expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher |
| 314 | " for '(' that sets it all off. |
| 315 | syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, |
| 316 | \ kconfigConfOptIfGExpNeg, |
| 317 | \ kconfigConfOptIfExprGroup |
| 318 | |
| 319 | syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, |
| 320 | \ kconfigConfOptIfGExpNCSym |
| 321 | |
| 322 | syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 323 | \ contained |
| 324 | \ nextgroup=@kconfigConfigIf, |
| 325 | \ kconfigConfOptIfGExpAnd, |
| 326 | \ kconfigConfOptIfGExpOr, |
| 327 | \ kconfigConfOptIfGExpEq, |
| 328 | \ kconfigConfOptIfGExpNEq |
| 329 | \ skipwhite skipnl |
| 330 | |
| 331 | syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 332 | \ contained |
| 333 | \ nextgroup=@kconfigConfigIf, |
| 334 | \ kconfigConfOptIfGExpAnd, |
| 335 | \ kconfigConfOptIfGExpOr, |
| 336 | \ kconfigConfOptIfGExpEq, |
| 337 | \ kconfigConfOptIfGExpNEq |
| 338 | \ skipwhite skipnl |
| 339 | |
| 340 | syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' |
| 341 | \ contained |
| 342 | \ nextgroup=kconfigConfOptIfExprGrpE, |
| 343 | \ kconfigConfOptIfGExpAnd, |
| 344 | \ kconfigConfOptIfGExpOr, |
| 345 | \ kconfigConfOptIfGExpEq, |
| 346 | \ kconfigConfOptIfGExpNEq |
| 347 | \ skipwhite skipnl |
| 348 | |
| 349 | syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, |
| 350 | \ kconfigConfOptIfGExpNCSym2 |
| 351 | |
| 352 | syn match kconfigConfOptIfGExpEq '=' |
| 353 | \ contained |
| 354 | \ nextgroup=@kconfigConfOptIfGExpSym2 |
| 355 | \ skipwhite |
| 356 | |
| 357 | syn match kconfigConfOptIfGExpNEq '!=' |
| 358 | \ contained |
| 359 | \ nextgroup=@kconfigConfOptIfGExpSym2 |
| 360 | \ skipwhite |
| 361 | |
| 362 | syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 363 | \ contained |
| 364 | \ nextgroup=kconfigConfOptIfExprGrpE, |
| 365 | \ kconfigConfOptIfGExpAnd, |
| 366 | \ kconfigConfOptIfGExpOr |
| 367 | \ skipwhite skipnl |
| 368 | |
| 369 | syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 370 | \ contained |
| 371 | \ nextgroup=kconfigConfOptIfExprGrpE, |
| 372 | \ kconfigConfOptIfGExpAnd, |
| 373 | \ kconfigConfOptIfGExpOr |
| 374 | \ skipwhite skipnl |
| 375 | |
| 376 | syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' |
| 377 | \ contained |
| 378 | \ nextgroup=kconfigConfOptIfExprGrpE, |
| 379 | \ kconfigConfOptIfGExpAnd, |
| 380 | \ kconfigConfOptIfGExpOr |
| 381 | \ skipwhite skipnl |
| 382 | |
| 383 | syn match kconfigConfOptIfGExpNeg '!' |
| 384 | \ contained |
| 385 | \ nextgroup=@kconfigConfigOptionIfGExp |
| 386 | \ skipwhite |
| 387 | |
| 388 | syn match kconfigConfOptIfGExpAnd '&&' |
| 389 | \ contained |
| 390 | \ nextgroup=@kconfigConfigOptionIfGExp |
| 391 | \ skipwhite |
| 392 | |
| 393 | syn match kconfigConfOptIfGExpOr '||' |
| 394 | \ contained |
| 395 | \ nextgroup=@kconfigConfigOptionIfGExp |
| 396 | \ skipwhite |
| 397 | |
| 398 | syn match kconfigConfOptIfExprGrpE ')' |
| 399 | \ contained |
| 400 | \ nextgroup=@kconfigConfigOptions, |
| 401 | \ kconfigConfOptIfExprAnd, |
| 402 | \ kconfigConfOptIfExprOr |
| 403 | \ skipwhite skipnl |
| 404 | |
| 405 | |
| 406 | syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, |
| 407 | \ kconfigConfOptExprNeg, |
| 408 | \ kconfigConfOptExprGroup |
| 409 | |
| 410 | syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, |
| 411 | \ kconfigConfOptExprNCSym |
| 412 | |
| 413 | syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 414 | \ contained |
| 415 | \ nextgroup=kconfigConfigOptionIf, |
| 416 | \ kconfigConfOptExprAnd, |
| 417 | \ kconfigConfOptExprOr, |
| 418 | \ kconfigConfOptExprEq, |
| 419 | \ kconfigConfOptExprNEq, |
| 420 | \ @kconfigConfigOptions |
| 421 | \ skipwhite skipnl |
| 422 | |
| 423 | syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 424 | \ contained |
| 425 | \ nextgroup=kconfigConfigOptionIf, |
| 426 | \ kconfigConfOptExprAnd, |
| 427 | \ kconfigConfOptExprOr, |
| 428 | \ kconfigConfOptExprEq, |
| 429 | \ kconfigConfOptExprNEq, |
| 430 | \ @kconfigConfigOptions |
| 431 | \ skipwhite skipnl |
| 432 | |
| 433 | syn match kconfigConfOptExprNCSym '\<\k\+\>' |
| 434 | \ contained |
| 435 | \ nextgroup=kconfigConfigOptionIf, |
| 436 | \ kconfigConfOptExprAnd, |
| 437 | \ kconfigConfOptExprOr, |
| 438 | \ kconfigConfOptExprEq, |
| 439 | \ kconfigConfOptExprNEq, |
| 440 | \ @kconfigConfigOptions |
| 441 | \ skipwhite skipnl |
| 442 | |
| 443 | syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, |
| 444 | \ kconfigConfOptExprNCSym2 |
| 445 | |
| 446 | syn match kconfigConfOptExprEq '=' |
| 447 | \ contained |
| 448 | \ nextgroup=@kconfigConfOptExprSym2 |
| 449 | \ skipwhite |
| 450 | |
| 451 | syn match kconfigConfOptExprNEq '!=' |
| 452 | \ contained |
| 453 | \ nextgroup=@kconfigConfOptExprSym2 |
| 454 | \ skipwhite |
| 455 | |
| 456 | syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 457 | \ contained |
| 458 | \ nextgroup=kconfigConfigOptionIf, |
| 459 | \ kconfigConfOptExprAnd, |
| 460 | \ kconfigConfOptExprOr, |
| 461 | \ @kconfigConfigOptions |
| 462 | \ skipwhite skipnl |
| 463 | |
| 464 | syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 465 | \ contained |
| 466 | \ nextgroup=kconfigConfigOptionIf, |
| 467 | \ kconfigConfOptExprAnd, |
| 468 | \ kconfigConfOptExprOr, |
| 469 | \ @kconfigConfigOptions |
| 470 | \ skipwhite skipnl |
| 471 | |
| 472 | syn match kconfigConfOptExprNCSym2 '\<\k\+\>' |
| 473 | \ contained |
| 474 | \ nextgroup=kconfigConfigOptionIf, |
| 475 | \ kconfigConfOptExprAnd, |
| 476 | \ kconfigConfOptExprOr, |
| 477 | \ @kconfigConfigOptions |
| 478 | \ skipwhite skipnl |
| 479 | |
| 480 | syn match kconfigConfOptExprNeg '!' |
| 481 | \ contained |
| 482 | \ nextgroup=@kconfigConfigOptionExpr |
| 483 | \ skipwhite |
| 484 | |
| 485 | syn match kconfigConfOptExprAnd '&&' |
| 486 | \ contained |
| 487 | \ nextgroup=@kconfigConfigOptionExpr |
| 488 | \ skipwhite |
| 489 | |
| 490 | syn match kconfigConfOptExprOr '||' |
| 491 | \ contained |
| 492 | \ nextgroup=@kconfigConfigOptionExpr |
| 493 | \ skipwhite |
| 494 | |
| 495 | syn match kconfigConfOptExprGroup '(' |
| 496 | \ contained |
| 497 | \ nextgroup=@kconfigConfigOptionGExp |
| 498 | \ skipwhite |
| 499 | |
| 500 | syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, |
| 501 | \ kconfigConfOptGExpNeg, |
| 502 | \ kconfigConfOptGExpGroup |
| 503 | |
| 504 | syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, |
| 505 | \ kconfigConfOptGExpNCSym |
| 506 | |
| 507 | syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 508 | \ contained |
| 509 | \ nextgroup=kconfigConfOptExprGrpE, |
| 510 | \ kconfigConfOptGExpAnd, |
| 511 | \ kconfigConfOptGExpOr, |
| 512 | \ kconfigConfOptGExpEq, |
| 513 | \ kconfigConfOptGExpNEq |
| 514 | \ skipwhite skipnl |
| 515 | |
| 516 | syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 517 | \ contained |
| 518 | \ nextgroup=kconfigConfOptExprGrpE, |
| 519 | \ kconfigConfOptGExpAnd, |
| 520 | \ kconfigConfOptGExpOr, |
| 521 | \ kconfigConfOptGExpEq, |
| 522 | \ kconfigConfOptGExpNEq |
| 523 | \ skipwhite skipnl |
| 524 | |
| 525 | syn match kconfigConfOptGExpNCSym '\<\k\+\>' |
| 526 | \ contained |
| 527 | \ nextgroup=kconfigConfOptExprGrpE, |
| 528 | \ kconfigConfOptGExpAnd, |
| 529 | \ kconfigConfOptGExpOr, |
| 530 | \ kconfigConfOptGExpEq, |
| 531 | \ kconfigConfOptGExpNEq |
| 532 | \ skipwhite skipnl |
| 533 | |
| 534 | syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, |
| 535 | \ kconfigConfOptGExpNCSym2 |
| 536 | |
| 537 | syn match kconfigConfOptGExpEq '=' |
| 538 | \ contained |
| 539 | \ nextgroup=@kconfigConfOptGExpSym2 |
| 540 | \ skipwhite |
| 541 | |
| 542 | syn match kconfigConfOptGExpNEq '!=' |
| 543 | \ contained |
| 544 | \ nextgroup=@kconfigConfOptGExpSym2 |
| 545 | \ skipwhite |
| 546 | |
| 547 | syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' |
| 548 | \ contained |
| 549 | \ nextgroup=kconfigConfOptExprGrpE, |
| 550 | \ kconfigConfOptGExpAnd, |
| 551 | \ kconfigConfOptGExpOr |
| 552 | \ skipwhite skipnl |
| 553 | |
| 554 | syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" |
| 555 | \ contained |
| 556 | \ nextgroup=kconfigConfOptExprGrpE, |
| 557 | \ kconfigConfOptGExpAnd, |
| 558 | \ kconfigConfOptGExpOr |
| 559 | \ skipwhite skipnl |
| 560 | |
| 561 | syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' |
| 562 | \ contained |
| 563 | \ nextgroup=kconfigConfOptExprGrpE, |
| 564 | \ kconfigConfOptGExpAnd, |
| 565 | \ kconfigConfOptGExpOr |
| 566 | \ skipwhite skipnl |
| 567 | |
| 568 | syn match kconfigConfOptGExpNeg '!' |
| 569 | \ contained |
| 570 | \ nextgroup=@kconfigConfigOptionGExp |
| 571 | \ skipwhite |
| 572 | |
| 573 | syn match kconfigConfOptGExpAnd '&&' |
| 574 | \ contained |
| 575 | \ nextgroup=@kconfigConfigOptionGExp |
| 576 | \ skipwhite |
| 577 | |
| 578 | syn match kconfigConfOptGExpOr '||' |
| 579 | \ contained |
| 580 | \ nextgroup=@kconfigConfigOptionGExp |
| 581 | \ skipwhite |
| 582 | |
| 583 | syn match kconfigConfOptExprGrpE ')' |
| 584 | \ contained |
| 585 | \ nextgroup=kconfigConfigOptionIf, |
| 586 | \ kconfigConfOptExprAnd, |
| 587 | \ kconfigConfOptExprOr |
| 588 | \ skipwhite skipnl |
| 589 | |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 590 | syn sync minlines=50 |
| 591 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 592 | hi def link kconfigTodo Todo |
| 593 | hi def link kconfigComment Comment |
| 594 | hi def link kconfigKeyword Keyword |
| 595 | hi def link kconfigPreProc PreProc |
| 596 | hi def link kconfigConditional Conditional |
| 597 | hi def link kconfigPrompt String |
| 598 | hi def link kconfigKeywordPrompt kconfigPrompt |
| 599 | hi def link kconfigPath String |
| 600 | hi def link kconfigSymbol String |
| 601 | hi def link kconfigConstantSymbol Constant |
| 602 | hi def link kconfigConfigOption Type |
| 603 | hi def link kconfigTypeDefinition kconfigConfigOption |
| 604 | hi def link kconfigTypeDefPrompt kconfigPrompt |
| 605 | hi def link kconfigInputPrompt kconfigConfigOption |
| 606 | hi def link kconfigPromptPrompt kconfigPrompt |
| 607 | hi def link kconfigDefaultValue kconfigConfigOption |
| 608 | hi def link kconfigDependencies kconfigConfigOption |
| 609 | hi def link kconfigReverseDependencies kconfigConfigOption |
| 610 | hi def link kconfigRevDepCSymbol kconfigConstantSymbol |
| 611 | hi def link kconfigRevDepNCSymbol kconfigSymbol |
| 612 | hi def link kconfigNumericalRanges kconfigConfigOption |
| 613 | hi def link kconfigRangeCSymbol kconfigConstantSymbol |
| 614 | hi def link kconfigRangeNCSymbol kconfigSymbol |
| 615 | hi def link kconfigRangeCSymbol2 kconfigConstantSymbol |
| 616 | hi def link kconfigRangeNCSymbol2 kconfigSymbol |
| 617 | hi def link kconfigHelpText Normal |
| 618 | hi def link kconfigDefBool kconfigConfigOption |
| 619 | hi def link kconfigDefBoolCSymbol kconfigConstantSymbol |
| 620 | hi def link kconfigDefBoolNCSymbol kconfigSymbol |
| 621 | hi def link kconfigOptional kconfigConfigOption |
| 622 | hi def link kconfigConfigOptionIf Conditional |
| 623 | hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol |
| 624 | hi def link kconfigConfOptIfExprNCSym kconfigSymbol |
| 625 | hi def link kconfigOperator Operator |
| 626 | hi def link kconfigConfOptIfExprEq kconfigOperator |
| 627 | hi def link kconfigConfOptIfExprNEq kconfigOperator |
| 628 | hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol |
| 629 | hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol |
| 630 | hi def link kconfigConfOptIfExprNeg kconfigOperator |
| 631 | hi def link kconfigConfOptIfExprAnd kconfigOperator |
| 632 | hi def link kconfigConfOptIfExprOr kconfigOperator |
| 633 | hi def link kconfigDelimiter Delimiter |
| 634 | hi def link kconfigConfOptIfExprGroup kconfigDelimiter |
| 635 | hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol |
| 636 | hi def link kconfigConfOptIfGExpNCSym kconfigSymbol |
| 637 | hi def link kconfigConfOptIfGExpEq kconfigOperator |
| 638 | hi def link kconfigConfOptIfGExpNEq kconfigOperator |
| 639 | hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol |
| 640 | hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol |
| 641 | hi def link kconfigConfOptIfGExpNeg kconfigOperator |
| 642 | hi def link kconfigConfOptIfGExpAnd kconfigOperator |
| 643 | hi def link kconfigConfOptIfGExpOr kconfigOperator |
| 644 | hi def link kconfigConfOptIfExprGrpE kconfigDelimiter |
| 645 | hi def link kconfigConfOptExprCSym kconfigConstantSymbol |
| 646 | hi def link kconfigConfOptExprNCSym kconfigSymbol |
| 647 | hi def link kconfigConfOptExprEq kconfigOperator |
| 648 | hi def link kconfigConfOptExprNEq kconfigOperator |
| 649 | hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol |
| 650 | hi def link kconfigConfOptExprNCSym2 kconfigSymbol |
| 651 | hi def link kconfigConfOptExprNeg kconfigOperator |
| 652 | hi def link kconfigConfOptExprAnd kconfigOperator |
| 653 | hi def link kconfigConfOptExprOr kconfigOperator |
| 654 | hi def link kconfigConfOptExprGroup kconfigDelimiter |
| 655 | hi def link kconfigConfOptGExpCSym kconfigConstantSymbol |
| 656 | hi def link kconfigConfOptGExpNCSym kconfigSymbol |
| 657 | hi def link kconfigConfOptGExpEq kconfigOperator |
| 658 | hi def link kconfigConfOptGExpNEq kconfigOperator |
| 659 | hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol |
| 660 | hi def link kconfigConfOptGExpNCSym2 kconfigSymbol |
| 661 | hi def link kconfigConfOptGExpNeg kconfigOperator |
| 662 | hi def link kconfigConfOptGExpAnd kconfigOperator |
| 663 | hi def link kconfigConfOptGExpOr kconfigOperator |
| 664 | hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup |
| 665 | |
| 666 | else |
| 667 | |
| 668 | syn keyword kconfigTodo contained TODO FIXME XXX NOTE |
| 669 | |
| 670 | syn match kconfigComment display '#.*$' contains=kconfigTodo |
| 671 | |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 672 | syn keyword kconfigKeyword config menuconfig comment mainmenu |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 673 | |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 674 | syn keyword kconfigConditional menu endmenu choice endchoice if endif |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 675 | |
| 676 | syn keyword kconfigPreProc source |
| 677 | \ nextgroup=kconfigPath |
| 678 | \ skipwhite |
| 679 | |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 680 | syn keyword kconfigTriState y m n |
| 681 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 682 | syn match kconfigSpecialChar contained '\\.' |
Bram Moolenaar | 8424a62 | 2006-04-19 21:23:36 +0000 | [diff] [blame] | 683 | syn match kconfigSpecialChar '\\$' |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 684 | |
| 685 | syn region kconfigPath matchgroup=kconfigPath |
| 686 | \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ |
| 687 | \ contains=kconfigSpecialChar |
| 688 | |
| 689 | syn region kconfigPath matchgroup=kconfigPath |
| 690 | \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ |
| 691 | \ contains=kconfigSpecialChar |
| 692 | |
| 693 | syn match kconfigPath '\S\+' |
| 694 | \ contained |
| 695 | |
| 696 | syn region kconfigString matchgroup=kconfigString |
| 697 | \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ |
| 698 | \ contains=kconfigSpecialChar |
| 699 | |
| 700 | syn region kconfigString matchgroup=kconfigString |
| 701 | \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ |
| 702 | \ contains=kconfigSpecialChar |
| 703 | |
| 704 | syn keyword kconfigType bool boolean tristate string hex int |
| 705 | |
| 706 | syn keyword kconfigOption prompt default requires select range |
| 707 | \ optional |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 708 | syn match kconfigOption 'depends\%( on\)\=' |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 709 | |
| 710 | syn keyword kconfigMacro def_bool def_tristate |
| 711 | |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 712 | syn region kconfigHelpText |
| 713 | \ matchgroup=kconfigOption |
| 714 | \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 715 | \ skip='^$' |
| 716 | \ end='^\z1\@!' |
| 717 | |
| 718 | hi def link kconfigTodo Todo |
| 719 | hi def link kconfigComment Comment |
| 720 | hi def link kconfigKeyword Keyword |
| 721 | hi def link kconfigConditional Conditional |
| 722 | hi def link kconfigPreProc PreProc |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 723 | hi def link kconfigTriState Boolean |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 724 | hi def link kconfigSpecialChar SpecialChar |
| 725 | hi def link kconfigPath String |
| 726 | hi def link kconfigString String |
| 727 | hi def link kconfigType Type |
| 728 | hi def link kconfigOption Identifier |
| 729 | hi def link kconfigHelpText Normal |
| 730 | hi def link kconfigmacro Macro |
| 731 | |
| 732 | endif |
| 733 | |
| 734 | let b:current_syntax = "kconfig" |
| 735 | |
| 736 | let &cpo = s:cpo_save |
| 737 | unlet s:cpo_save |