mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Fix rules not being parsed entirely
This commit is contained in:
parent
edb52a989e
commit
f68849c65f
3 changed files with 16 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue