Skip to content

Commit d5f5cb2

Browse files
author
steve
committed
Added quote supports (both single and double) to key and acl statements
1 parent 50341b4 commit d5f5cb2

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

syntax/bind-named.vim

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,22 @@ syn region namedA_AML contained start=+{+ end=+}+
11081108

11091109
" acl <string> { <address_match_element>; ... }; // may occur multiple times
11101110
hi link namedA_ACLIdentifier namedHL_ACLName
1111+
syn region namedA_ACLIdentifier contained start=+'+ skip="\\'" end=+'+
1112+
\ skipwhite skipnl skipempty
1113+
\ nextgroup=
1114+
\ namedA_AML,
1115+
\ namedA_AML_Not_Operator,
1116+
\ namedE_UnexpectedSemicolon,
1117+
\ namedE_UnexpectedRParen,
1118+
\ namedE_MissingLParen
1119+
syn region namedA_ACLIdentifier contained start=+"+ skip="\\'" end=+"+
1120+
\ skipwhite skipnl skipempty
1121+
\ nextgroup=
1122+
\ namedA_AML,
1123+
\ namedA_AML_Not_Operator,
1124+
\ namedE_UnexpectedSemicolon,
1125+
\ namedE_UnexpectedRParen,
1126+
\ namedE_MissingLParen
11111127
syn match namedA_ACLIdentifier contained /\<[0-9a-zA-Z\-_]\{1,63}\>/
11121128
\ skipwhite skipnl skipempty
11131129
\ nextgroup=
@@ -1647,7 +1663,20 @@ syn region namedK_Section contained start=+{+ end=+}+
16471663
\ namedSemicolon,
16481664
\ namedNotSemicolon
16491665

1650-
hi link namedStmtKeyIdent namedHL_Identifier
1666+
hi link namedStmtKeyIdent namedHL_Identifie
1667+
syn region namedStmtKeyIdent contained start=+"+ skip="\\'" end=+"+
1668+
\ skipwhite skipnl skipempty
1669+
\ nextgroup=
1670+
\ namedK_Section,
1671+
\ namedNotParem,
1672+
\ namedError
1673+
syn region namedStmtKeyIdent contained start=+'+ skip="\\'" end=+'+
1674+
\ skipwhite skipnl skipempty
1675+
\ nextgroup=
1676+
\ namedK_Section,
1677+
\ namedNotParem,
1678+
\ namedError
1679+
16511680
syn match namedStmtKeyIdent contained /[a-zA-Z0-9_\-]\{1,63}/
16521681
\ skipwhite skipnl skipempty
16531682
\ nextgroup=

test/example-9.16-named.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ include 'a-z09[]`~!@#$%^&*()"_=+[]|\:"?><,./';
2121
include a-z09[]`~!@#$%^&*()'"=_+[]|\:'"?><,./;
2222

2323
acl j { asdasdf ;};
24+
acl "j" { asdasdf ;};
25+
acl 'j' { asdasdf ;};
2426
acl j { ! 127.0.0.1; };
2527
acl j{ }; // empty ACL
2628
acl k { none; any; { localhost; { any; none; }; }; };
@@ -297,6 +299,8 @@ dyndb example "/usr/lib/mydriver[1, 2];_/driver.so" {
297299
dyndb sample "sample.so" { example.nil. arpa. };
298300

299301
key key_name { algorithm SHA512-AES; secret ASDASDASDASDASDAaDASaASDaSD;};
302+
key 'key_name' { algorithm SHA512-AES; secret ASDASDASDASDASDAaDASaASDaSD;};
303+
key "key_name" { algorithm SHA512-AES; secret ASDASDASDASDASDAaDASaASDaSD;};
300304
key my_secret_name { algorithm SHA256-AES-CDC; secret ASDASDASDASDASDASDASDASDASD; };
301305
key my_secret_name { algorithm SHA512-AES; secret ASDASDASDASDASDASDASDASDASD; };
302306

0 commit comments

Comments
 (0)