commit 1254ececec090d507654c83649160818a242515a from: Omar Polo date: Thu Apr 28 09:31:42 2022 UTC fix error handling of "]" commit - 158f51d560e8e24b033a4a495008086d9a690e6d commit + 1254ececec090d507654c83649160818a242515a blob - 2beb70f988221283dffd078adf7facefbea9cac3 blob + 6f04f56e44697153584a1dfa23f2cde8c39ba6da --- bfc.hs +++ bfc.hs @@ -68,8 +68,8 @@ parser (x:xs) stack = case x of BracketOpen -> parser xs ([]:stack) BracketClose -> case stack of - (y:ys) -> parser xs $ pushexpr (Loop (reverse y)) ys - _ -> Left "unexpected end of loop" + (y:(z:zs)) -> parser xs $ pushexpr (Loop (reverse y)) (z:zs) + _ -> Left "unexpected end of loop" _ -> parser xs $ pushexpr expr stack where expr = case x of Plus -> Inc