Skip to content

Commit 41a5fe0

Browse files
author
steve
committed
Add more clarification to syntax header; more specific highlighters
used.
1 parent a7ec4c3 commit 41a5fe0

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

syntax/bind-named.vim

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
" Vim syntax file for ISC BIND v9.16 named.conf configuration file
22
" Language: ISC BIND named.conf configuration file
33
" Maintainer: egberts <egberts@github.com>
4-
" Last change: 2020-04-22
4+
" Last change: 2020-04-24
55
" Filenames: named.conf, rndc.conf
66
" Filenames: named[-_]*.conf, rndc[-_]*.conf
77
" Filenames: *[-_]named.conf
8-
" Location: http://github.com/egberts/vim-syntax-bind-named
8+
" Location: https://github.com/egberts/vim-syntax-bind-named
99
" License: MIT license
1010
" Remarks:
11+
" Bug Report: https://github.com/egberts/vim-syntax-bind-named/issues
1112
"
12-
" Still in BETA version
1313
"
1414
" Inspired by Nick Hibma <nick@van-laarhoven.org> 'named.vim',
1515
" also by glory hump <rnd@web-drive.ru>, and Marcin Dalecki.
1616
"
1717
" Jumpstarted to Bind 9.15 by Egberts <egberts@github.com>
1818
"
1919
" This file could do with a lot of improvements, so comments are welcome.
20-
" Please submit the named.conf (segment) with any comments.
20+
" Please submit the afflicted but privatized version of your
21+
" named.conf (segment) file snippet with any comments.
2122
"
2223
" Basic highlighting is covered for all Bind configuration
23-
" options. Only normal (defaults is white) highlight gets
24-
" used to show 'undetected' Bind syntax.
24+
" options. Only 'Normal' (default to black; if dark backgroud, white)
25+
" highlight gets used to show 'undetected' Bind syntax.
2526
"
2627
" Every valid keywords get colorized. Every character-valid
27-
" values get colorized, some range-checking here.
28+
" values get colorized, some range-checking done here.
2829
"
29-
" New Bind 9.13+ terminologies here:
30-
" Stmt - top-level keyword (formerly 'clause' from Bind 4
31-
" to 9.11)
30+
" Most importantly, every semicolon must be colorized.
31+
"
32+
" New Bind 9.13+ terminologies/notation used here:
33+
" Stmt - top-level statement keyword (formerly 'clause'
34+
" from Bind 4 to 9.11)
3235
" Opt - an option keyword found within each of its
3336
" top-level keywords.
3437
" Clause - very specific keywords used within each of its
3538
" option statement
3639
"
3740
" Syntax Naming Convention:
3841
" All macro names that are defined here start with
39-
" 'named' prefix. This is a Vim standard.
42+
" 'named' prefix. This is a Vim standard to ensure
43+
" no conflict with global Vim namespace.
4044
"
4145
" Each macro name contains a camel-case notation to
4246
" denote each shorten word that identifies the:
@@ -88,7 +92,8 @@
8892
" like Vim identifier here.
8993
" Another reason why you shouldn't use period or slashes
9094
" in ACL names because it would only confuses our
91-
" simplistic IP address syntax processing here.
95+
" simplistic IP address syntax processing here. But I
96+
" do test for these corner-cases, in case.
9297
"
9398
" isident is used for the most-lax naming convention of
9499
" all Bind identifiers combined. Those naming convention
@@ -160,6 +165,7 @@ hi link namedHL_Hexidecimal namedHL_Number
160165
hi link namedHL_Wildcard namedHL_Builtin
161166
hi link namedHL_Base64 namedHL_Identifier " RFC 3548
162167
hi link namedHL_ACLName namedHL_Identifier
168+
hi link namedHL_Algorithm namedHL_Identifier
163169
hi link namedHL_ClassName namedHL_Identifier
164170
hi link namedHL_Filespec namedHL_Identifier
165171
hi link namedHL_KeyName namedHL_Identifier
@@ -858,7 +864,7 @@ syn match namedKeySecretValue contained /\<[0-9a-zA-Z\+\=\/]\{1,4099}\s*;/he=e-1
858864
hi link namedKeyName namedHL_KeyName
859865
syn match namedKeyName contained /\<[0-9a-zA-Z\-_]\{1,63}/ skipwhite
860866

861-
hi link namedKeyAlgorithmName namedHL_String
867+
hi link namedKeyAlgorithmName namedHL_Algorithm
862868
syn match namedKeyAlgorithmName contained /\<[0-9A-Za-z\-_]\{1,4096}/ skipwhite
863869

864870
hi link namedMasterName namedHL_MasterName
@@ -965,9 +971,10 @@ syn match named_E_SuffixDomain_SC contained /\<[0-9A-Za-z\._\-]{1,1023}[A-Za-z\.
965971
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
966972
" Nesting of PATTERNS
967973
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
968-
""""" We are not ready for solid RED highlighting yet, too many errors
974+
" We'll do error RED highlighting on all statement firstly, then later on
975+
" all the options, then all the clauses.
969976
hi link namedStmtKeywordUnknown namedHL_Error
970-
syn match namedStmtKeywordUnknown /\<\S\{1,1111}\>/
977+
syn match namedStmtKeywordUnknown /\<\S\{1,64}\>/
971978

972979

973980
hi link namedInclude namedHL_Include

test/example-9.16-named.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ zone "_._._._.0.0.4.0.8.1.6.0.1.0.0.2.IP6.INT" {
15461546
1;
15471547
oopsie ;
15481548
a;
1549-
no_such_keyword;
1549+
no_such_statement;
15501550
aasdfasddfasdfasddfsadff;
15511551
acl // this is invalid
15521552

@@ -1556,10 +1556,10 @@ acl{} // this is invalid
15561556
acl // this is invalid
15571557
acl { !}; // this is invalid
15581558
acl missing_Left_CurlyBrace oopsie;
1559-
acl missing_Right_CurlyBrace { ;
1559+
acl missing_Right_CurlyBrace { ; // TODO Bug on missing right curly
15601560
acl link_local_with_zone_index_prefix { fe08/48%eth1; }; // this should fail
15611561
acl link_local_with_zone_index { fe80%eth1; }; // this fails (it's fe08, not fe80)
1562-
acl link_local_with_zone_index { fe08::8%eth0; }; // this fails (missing 7)
1562+
acl link_local_with_zone_index { fe08::8%eth0; }; // TODO this fails (missing 7)
15631563
acl link_local_with_zone_index { fd57:1d29:4f94:1:216:36ff:fe00:1%eth0; }; // valid?
15641564
acl link_local_with_zone_index { fe08::7:8:127.0.0.1%2; }; // valid?
15651565

0 commit comments

Comments
 (0)