Fix error in parser combinator

This commit is contained in:
2026-01-18 22:03:34 -08:00
parent 28a0d461f1
commit 43401156eb
4 changed files with 17 additions and 3 deletions

View File

@@ -101,7 +101,7 @@ instance Applicative Parser where
instance Alternative Parser where
(P pa) <|> (P pb) = P $ \last toks com ops col =>
case pa last toks False ops col of
OK a last' toks' _ ops => OK a last' toks' com ops
OK a last' toks' com' ops => OK a last' toks' (com || com') ops
-- Fail err last' toks' com ops => Fail err last' toks' com ops
Fail err last' toks' True ops => Fail err last' toks' True ops
Fail err last' toks' False ops => pb last toks com ops col