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