diff --git a/curlylint/parse.py b/curlylint/parse.py index f4eb598..3770725 100644 --- a/curlylint/parse.py +++ b/curlylint/parse.py @@ -706,12 +706,7 @@ def make_parser(config=None): if config is None: config = {} - content_ = None - - @P.generate - def content(): - c = yield content_ - return c + content = P.forward_declaration() jinja = make_jinja_parser(config, content) @@ -719,16 +714,18 @@ def content(): opt_container = make_jinja_optional_container_parser(config, content, jinja) - content_ = interpolated( - ( - quick_text - | comment - | dtd - | element - | opt_container - | jinja - | slow_text_char - ).many() + content.become( + interpolated( + ( + quick_text + | comment + | dtd + | element + | opt_container + | jinja + | slow_text_char + ).many() + ) ) - return {"content": content_, "jinja": jinja, "element": element} + return {"content": content, "jinja": jinja, "element": element} diff --git a/setup.py b/setup.py index 2314b08..b7a0849 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ ], python_requires=">=3.6", install_requires=[ - "parsy==1.1.0", + "parsy>=1.4.0", "attrs>=17.2.0", "click>=6.5", "toml>=0.9.4",