Allow nginx parser to handle empty file (#8895)

* Allow parsing empty files

* add unit test

* lint

* update parser_test

* Update configurator_test

* update changelog
This commit is contained in:
ohemorange
2021-06-11 09:21:52 +10:00
committed by GitHub
parent 0c637860cd
commit b48e336554
5 changed files with 12 additions and 6 deletions
@@ -9,7 +9,6 @@ from pyparsing import Combine
from pyparsing import Forward
from pyparsing import Group
from pyparsing import Literal
from pyparsing import OneOrMore
from pyparsing import Optional
from pyparsing import QuotedString
from pyparsing import Regex
@@ -57,7 +56,7 @@ class RawNginxParser:
block_innards = Group(ZeroOrMore(contents) + space).leaveWhitespace()
block << block_begin + left_bracket + block_innards + right_bracket
script = OneOrMore(contents) + space + stringEnd
script = ZeroOrMore(contents) + space + stringEnd
script.parseWithTabs().leaveWhitespace()
def __init__(self, source):