Fix rules not being parsed entirely

This commit is contained in:
Joscha
2021-05-25 15:42:46 +02:00
parent edb52a989e
commit f68849c65f
3 changed files with 16 additions and 11 deletions

View File

@ -266,6 +266,11 @@ def parse_whitespace(line: Line) -> None:
line.advance()
def parse_eol(line: Line) -> None:
if line.get() is not None:
raise RuleParseError(line, "Expected end of line")
def parse_rule(line: Line) -> Rule:
# Parse left side
leftindex = line.index
@ -291,6 +296,8 @@ def parse_rule(line: Line) -> Rule:
else:
rightpath = PurePath(right)
parse_eol(line)
# Dispatch
if arrowname == "":
return NormalRule(PurePath(left), rightpath)