Skip to content

Commit

Permalink
Simplifies strings handling + Don't consider time strings as quoted ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel FORESTIER committed Mar 16, 2020
1 parent 00cd27d commit 549fc88
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Nftables.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,16 @@ contexts:

values:
- include: safe-values
- include: time-string
- include: unquoted-string

safe-values:
- include: strings
- include: quoted-string
- include: network-addresses
- include: numerics
- include: variables
- include: anonymous-set

strings:
- include: quoted-string
- include: time-string

quoted-string:
# Apparently nftables supports double-quoted strings only.
# `prototype` won't be propagated, but `line-continuation` has to be consumed.
Expand All @@ -143,14 +140,14 @@ contexts:
scope: punctuation.definition.string.end.nftables
pop: true

unquoted-string:
- match: \b({{identifier_extended}})\b
scope: string.unquoted.nftables

time-string:
- match: \b((?:\d+[wdhms])+)\b
scope: string.unquoted.time-string.nftables

unquoted-string:
- match: \b({{identifier_extended}})\b
scope: string.unquoted.nftables

network-addresses:
- match: ({{mac_address}})
scope: constant.numeric.mac-address.nftables
Expand Down

0 comments on commit 549fc88

Please sign in to comment.