From 10ecda6a31a9779353663e58799d463753319ba5 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Thu, 9 Feb 2023 15:06:36 +0300 Subject: [PATCH] fixed parse error --- lib/Data/Config/Suckless/Parse/Megaparsec.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Data/Config/Suckless/Parse/Megaparsec.hs b/lib/Data/Config/Suckless/Parse/Megaparsec.hs index 5640e13..93ecf48 100644 --- a/lib/Data/Config/Suckless/Parse/Megaparsec.hs +++ b/lib/Data/Config/Suckless/Parse/Megaparsec.hs @@ -161,14 +161,12 @@ parseSyntax :: forall c . MegaConstraints c parseSyntax = parse (merely (syntax sc)) "input" top :: forall c . MegaConstraints c => Parser [Syntax c] -top = many $ do - t <- topStmt +top = do sc - pure t + many topStmt topTerm :: forall c . MegaConstraints c => Parser (Syntax c) topTerm = do - L.lexeme sc $ do co <- MegaContext . Just <$> getOffset s0 <- symbol scTop ss <- many (syntax scTop) @@ -177,7 +175,7 @@ topTerm = do pure $ List co (s0:ss) topStmt :: forall c . MegaConstraints c => Parser (Syntax c) -topStmt = topTerm <|> syntax scTop +topStmt = topTerm <|> syntax sc parseTop :: forall c . MegaConstraints c => String -> Either ParseFail [Syntax c]