|
| 1 | +# Kconfig syntax |
| 2 | +# |
| 3 | +# Specifications: |
| 4 | +# https://docs.kernel.org/kbuild/kconfig-language.html |
| 5 | +# https://github.com/ulfalizer/Kconfiglib?tab=readme-ov-file#kconfig-extensions |
| 6 | + |
| 7 | +define kword yellow |
| 8 | +define type brightmagenta |
| 9 | +define property brightmagenta |
| 10 | +define condition yellow |
| 11 | +define operator brightcyan |
| 12 | +define brace brightcyan |
| 13 | +define number cyan |
| 14 | +define string green |
| 15 | +define escape brightgreen |
| 16 | +define comment brown |
| 17 | + |
| 18 | +context default |
| 19 | + keyword whole linestart \[\t\s\]config kword |
| 20 | + keyword whole linestart \[\t\s\]menuconfig kword |
| 21 | + keyword whole linestart \[\t\s\]menu kword |
| 22 | + keyword whole linestart \[\t\s\]endmenu kword |
| 23 | + keyword whole linestart \[\t\s\]mainmenu kword |
| 24 | + keyword whole linestart \[\t\s\]choice kword |
| 25 | + keyword whole linestart \[\t\s\]endchoice kword |
| 26 | + keyword whole linestart \[\t\s\]comment kword |
| 27 | + keyword whole linestart \[\t\s\]source kword |
| 28 | + keyword whole linestart \[\t\s\]osource kword |
| 29 | + keyword whole linestart \[\t\s\]rsource kword |
| 30 | + keyword whole linestart \[\t\s\]orsource kword |
| 31 | + |
| 32 | + keyword whole if condition |
| 33 | + keyword whole linestart \[\t\s\]endif condition |
| 34 | + |
| 35 | + keyword whole linestart \[\t\s\]bool type |
| 36 | + keyword whole linestart \[\t\s\]tristate type |
| 37 | + keyword whole linestart \[\t\s\]string type |
| 38 | + keyword whole linestart \[\t\s\]hex type |
| 39 | + keyword whole linestart \[\t\s\]int type |
| 40 | + |
| 41 | + keyword whole linestart \[\t\s\]def_bool type |
| 42 | + keyword whole linestart \[\t\s\]def_tristate type |
| 43 | + keyword whole linestart \[\t\s\]def_string type |
| 44 | + keyword whole linestart \[\t\s\]def_hex type |
| 45 | + keyword whole linestart \[\t\s\]def_int type |
| 46 | + |
| 47 | + keyword whole linestart \[\t\s\]prompt property |
| 48 | + keyword whole linestart \[\t\s\]default property |
| 49 | + keyword whole linestart \[\t\s\]depends\son property |
| 50 | + keyword whole linestart \[\t\s\]select property |
| 51 | + keyword whole linestart \[\t\s\]imply property |
| 52 | + keyword whole linestart \[\t\s\]transitional property |
| 53 | + keyword whole linestart \[\t\s\]visible\sif property |
| 54 | + keyword whole linestart \[\t\s\]range property |
| 55 | + keyword whole linestart \[\t\s\]option property |
| 56 | + keyword whole linestart \[\t\s\]optional property |
| 57 | + keyword whole linestart \[\t\s\]help property |
| 58 | + keyword whole linestart \[\t\s\]---help--- property |
| 59 | + |
| 60 | + keyword = operator |
| 61 | + keyword > operator |
| 62 | + keyword < operator |
| 63 | + keyword >= operator |
| 64 | + keyword <= operator |
| 65 | + keyword || operator |
| 66 | + keyword && operator |
| 67 | + keyword ! operator |
| 68 | + |
| 69 | + keyword ( brace |
| 70 | + keyword ) brace |
| 71 | + |
| 72 | + keyword whole 0x\{0123456789ABCDEFabcdef\}\[0123456789ABCDEFabcdef\] number |
| 73 | + keyword whole \{0123456789\}\[0123456789\] number |
| 74 | + |
| 75 | + # sometimes quotes are escaped in help like \"foo\" => do not start string context |
| 76 | + keyword \\" |
| 77 | + |
| 78 | +context # \n comment |
| 79 | + spellcheck |
| 80 | + |
| 81 | +context " " string |
| 82 | + keyword \\" escape |
| 83 | + keyword \\\\ escape |
0 commit comments