diff --git a/parserbase/parser.py b/parserbase/parser.py index a29fa2c..8e27619 100644 --- a/parserbase/parser.py +++ b/parserbase/parser.py @@ -235,7 +235,7 @@ class FileParser: r"\[EXPORT][\s]*:[\s]*\[COMMENT]", moving_window[current_idx] ) if not descrip_match: - while current_idx > 0: + while True: if re.search( break_pattern, moving_window[current_idx] ): @@ -245,6 +245,8 @@ class FileParser: ) if descrip_match: break + if current_idx <= 0: + break current_idx -= 1 if descrip_match: current_build_idx = current_idx