summaryrefslogtreecommitdiff
path: root/reconfigure/parsers/bind9.py
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:31 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:31 +0200
commit52702d36437649ace8a54d49d4d4292184a528d6 (patch)
treed674dfbcaba50712618f6ae3cd168cce53adb13c /reconfigure/parsers/bind9.py
parentfec1da7e6ea8a3b3b03befa4ff8dd31d539f163d (diff)
Imported Upstream version 0.1.59+git20140824
Diffstat (limited to 'reconfigure/parsers/bind9.py')
-rw-r--r--reconfigure/parsers/bind9.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/reconfigure/parsers/bind9.py b/reconfigure/parsers/bind9.py
index 123a799..ab089c4 100644
--- a/reconfigure/parsers/bind9.py
+++ b/reconfigure/parsers/bind9.py
@@ -8,14 +8,13 @@ class BIND9Parser (NginxParser):
"""
tokens = [
- (r"[\w_]+\s*?.*?{", lambda s, t: ('section_start', t)),
- (r"[\w\d_:.]+?.*?;", lambda s, t: ('option', t)),
- (r"\".*?\"\s*;", lambda s, t: ('option', t)),
- (r"\s", lambda s, t: 'whitespace'),
- (r"$^", lambda s, t: 'newline'),
+ (r"(acl|key|masters|server|trusted-keys|managed-keys|controls|logging|lwres|options|view|zone|inet|channel|category|listen-on|search|avoid-v4-udp-ports|avoid-v6-udp-ports|blackhole|listen-on|listen-on-v6|allow-recursion|allow-recursion-on|sortlist|topology|rrset-order|dual-stack-servers|disable-algorithms|dns64|forwarders|rrset-order|update-policy|also-notify|allow-notify|rate-limit)\s+?([^\s{}]*\s*)*{", lambda s, t: ('section_start', t)),
(r"\#.*?\n", lambda s, t: ('comment', t)),
(r"//.*?\n", lambda s, t: ('comment', t)),
(r"/\*.*?\*/", lambda s, t: ('comment', t)),
+ (r"((([^\s{};#]+)|({\s*([^\s{};#]+;\s*)*}))\s*?)+;", lambda s, t: ('option', t)),
+ (r"\s", lambda s, t: 'whitespace'),
+ (r"$^", lambda s, t: 'newline'),
(r"\};", lambda s, t: 'section_end'),
]
token_section_end = '};'