|
| 1 | +if polyglot#init#is_disabled(expand('<sfile>:p'), 'nftables', 'syntax/nftables.vim') |
| 2 | + finish |
| 3 | +endif |
| 4 | + |
| 5 | +if exists('b:current_syntax') |
| 6 | + finish |
| 7 | +endif |
| 8 | + |
| 9 | +syn match nftablesSet /{.*}/ contains=nftablesSetEntry |
| 10 | +syn match nftablesSetEntry /[a-zA-Z0-9]\+/ contained |
| 11 | +hi def link nftablesSet Keyword |
| 12 | +hi def link nftablesSetEntry Operator |
| 13 | + |
| 14 | +syn match nftablesNumber "\<[0-9A-Fa-f./:]\+\>" contains=nftablesMask,nftablesDelimiter |
| 15 | +syn match nftablesHex "\<0x[0-9A-Fa-f]\+\>" |
| 16 | +syn match nftablesDelimiter "[./:]" contained |
| 17 | +syn match nftablesMask "/[0-9.]\+" contained contains=nftablesDelimiter |
| 18 | +hi def link nftablesNumber Number |
| 19 | +hi def link nftablesHex Number |
| 20 | +hi def link nftablesDelimiter Operator |
| 21 | +hi def link nftablesMask Operator |
| 22 | + |
| 23 | +syn region Comment start=/#/ end=/$/ |
| 24 | +syn region String start=/"/ end=/"/ |
| 25 | +syn keyword Function flush |
| 26 | +syn keyword Function table chain map |
| 27 | +syn keyword Statement type hook |
| 28 | +syn keyword Type ip ip6 inet arp bridge |
| 29 | +syn keyword Type filter nat route |
| 30 | +syn keyword Type ether vlan arp ip icmp igmp ip6 icmpv6 tcp udp udplite sctp dccp ah esp comp icmpx |
| 31 | +syn keyword Type ct |
| 32 | +syn keyword Type length protocol priority mark iif iifname iiftype oif oifname oiftype skuid skgid rtclassid |
| 33 | +syn keyword Constant prerouting input forward output postrouting |
| 34 | + |
| 35 | +syn keyword Special snat dnat masquerade redirect |
| 36 | +syn keyword Special accept drop reject queue |
| 37 | +syn keyword Keyword continue return jump goto |
| 38 | +syn keyword Keyword counter log limit |
| 39 | +syn keyword Keyword define |
| 40 | + |
| 41 | +let b:current_syntax = 'nftables' |
0 commit comments