summaryrefslogtreecommitdiff
path: root/reconfigure/parsers/nginx.py
diff options
context:
space:
mode:
Diffstat (limited to 'reconfigure/parsers/nginx.py')
-rw-r--r--reconfigure/parsers/nginx.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/reconfigure/parsers/nginx.py b/reconfigure/parsers/nginx.py
index 661cfcd..f0fe202 100644
--- a/reconfigure/parsers/nginx.py
+++ b/reconfigure/parsers/nginx.py
@@ -9,11 +9,11 @@ class NginxParser (BaseParser):
"""
tokens = [
+ (r"[\w_]+\s*?.*?{", lambda s, t: ('section_start', t)),
(r"[\w_]+?.+?;", lambda s, t: ('option', t)),
(r"\s", lambda s, t: 'whitespace'),
(r"$^", lambda s, t: 'newline'),
(r"\#.*?\n", lambda s, t: ('comment', t)),
- (r"[\w_]+\s*?.*?{", lambda s, t: ('section_start', t)),
(r"\}", lambda s, t: 'section_end'),
]
token_comment = '#'
@@ -44,7 +44,7 @@ class NginxParser (BaseParser):
next_comment += '\n'
next_comment += token[1].strip('#/*').strip()
if token[0] == 'option':
- if ' ' in token[1]:
+ if ' ' in token[1] and not token[1][0] in ['"', "'"]:
k, v = token[1].split(None, 1)
else:
v = token[1]