aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yapymake/makefile/parse_util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yapymake/makefile/parse_util.py b/yapymake/makefile/parse_util.py
index f31e970..ad1e363 100644
--- a/yapymake/makefile/parse_util.py
+++ b/yapymake/makefile/parse_util.py
@@ -47,7 +47,7 @@ def tag(tag_text: str) -> Parser[None]:
def take_while1(predicate: Callable[[str], bool]) -> Parser[str]:
def parse(text: str) -> ParseResult[str]:
- if not predicate(text[0]):
+ if len(text) == 0 or not predicate(text[0]):
return None
for i in range(1, len(text)):
if not predicate(text[i]):