Compare commits

...

4 commits

Author SHA1 Message Date
theredcmdcraft 3ae5f19824
Update runtime/syntax/nftables.yaml
removed the shebang type

Co-authored-by: にてん <127052329+niten94@users.noreply.github.com>
2024-06-24 22:34:51 +02:00
theredcmdcraft 0aa2766b66
Update runtime/syntax/nftables.yaml
switch type to color type "type" and added some keywords counter, map, set and table

Co-authored-by: にてん <127052329+niten94@users.noreply.github.com>
2024-06-24 22:33:41 +02:00
theredcmdcraft 4019c17050
changed name to identifier.var and refactored regex
Co-authored-by: にてん <127052329+niten94@users.noreply.github.com>
2024-06-24 22:32:32 +02:00
theredcmdcraft f313140489
Update runtime/syntax/nftables.yaml
rule first keyword suggestion

Co-authored-by: にてん <127052329+niten94@users.noreply.github.com>
2024-06-24 22:30:32 +02:00

View file

@ -5,13 +5,14 @@ detect:
header: "^flush +ruleset"
rules:
- statement: "(chain|define|table)"
- type: "\\b(chain|counter|map|ruleset|set|table)\\b"
- symbol: "(=)"
- diff-modified: "(flush|type|counter)"
- special: "\\b(hook|policy|type)\\b"
- special: "\\b(icmp|icmpv6|iif|iifname|ip|ip6|oif|oifname|tcp|udp)\\b"
- statement: "\\b(accept|define|drop|flush|goto|jump)\\b"
- constant.string.char: "(;)"
- constant.string: '([\"]{1})(.*)([\"]{1})'
- type: "(\\#\\!)"
- preproc: "((([$])[a-zA-Z0-9\\_\\-\\+]{1,250})|(([A-Z]{1,})[A-Z\\_]{1,250}))"
- identifier.var: "\\b(\\$[a-zA-Z_][a-zA-Z0-9_-]*)\\b"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"