mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:04:31 +02:00
lint & tweak
This commit is contained in:
@@ -40,7 +40,6 @@ class RawNginxParser(object):
|
|||||||
if_statement = space + Literal("if") + space + condition + space
|
if_statement = space + Literal("if") + space + condition + space
|
||||||
|
|
||||||
map_statement = space + Literal("map") + space + nonspace + space + dollar_var + space
|
map_statement = space + Literal("map") + space + nonspace + space + dollar_var + space
|
||||||
|
|
||||||
# This is NOT an accurate way to parse nginx map entries; it's almost
|
# This is NOT an accurate way to parse nginx map entries; it's almost
|
||||||
# certianly too permissive and may be wrong in other ways, but it should
|
# certianly too permissive and may be wrong in other ways, but it should
|
||||||
# preserve things correctly in mmmmost or all cases.
|
# preserve things correctly in mmmmost or all cases.
|
||||||
@@ -49,7 +48,6 @@ class RawNginxParser(object):
|
|||||||
# - I can neither prove nor disprove that it is corect wrt all escaped
|
# - I can neither prove nor disprove that it is corect wrt all escaped
|
||||||
# semicolon situations
|
# semicolon situations
|
||||||
# Addresses https://github.com/fatiherikli/nginxparser/issues/19
|
# Addresses https://github.com/fatiherikli/nginxparser/issues/19
|
||||||
|
|
||||||
map_entry = space + nonspace + value + space + semicolon
|
map_entry = space + nonspace + value + space + semicolon
|
||||||
map_block = Forward()
|
map_block = Forward()
|
||||||
map_block << Group(
|
map_block << Group(
|
||||||
@@ -60,18 +58,14 @@ class RawNginxParser(object):
|
|||||||
Group(ZeroOrMore(Group(comment | map_entry)) + space).leaveWhitespace() +
|
Group(ZeroOrMore(Group(comment | map_entry)) + space).leaveWhitespace() +
|
||||||
right_bracket)
|
right_bracket)
|
||||||
|
|
||||||
|
|
||||||
block = Forward()
|
block = Forward()
|
||||||
|
|
||||||
block << Group(
|
block << Group(
|
||||||
# key could for instance be "server" or "http", or "location" (in which case
|
# key could for instance be "server" or "http", or "location" (in which case
|
||||||
# location_statement needs to have a non-empty location)
|
# location_statement needs to have a non-empty location)
|
||||||
(Group(space + key + location_statement) ^ Group(if_statement)).leaveWhitespace() +
|
(Group(space + key + location_statement) ^ Group(if_statement)).leaveWhitespace() +
|
||||||
left_bracket +
|
left_bracket +
|
||||||
Group(ZeroOrMore(Group(comment | assignment) | block | map_block) + space).leaveWhitespace() +
|
Group(ZeroOrMore(Group(comment | assignment) | block | map_block) + space).leaveWhitespace()
|
||||||
right_bracket)
|
+ right_bracket)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
script = OneOrMore(Group(comment | assignment) ^ block ^ map_block) + space + stringEnd
|
script = OneOrMore(Group(comment | assignment) ^ block ^ map_block) + space + stringEnd
|
||||||
script.parseWithTabs()
|
script.parseWithTabs()
|
||||||
|
|||||||
Reference in New Issue
Block a user