diff --git a/flake.nix b/flake.nix index e72a7b1..6f25638 100644 --- a/flake.nix +++ b/flake.nix @@ -44,9 +44,9 @@ outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs: # shell = ./shell.nix # Additional build intputs of the default shell - # shellExtBuildInputs = {pkgs}: with pkgs; [ - # haskellPackages.haskell-language-server - # ]; + shellExtBuildInputs = {pkgs}: with pkgs; [ + haskellPackages.haskell-language-server + ]; # Wether to build hoogle in the default shell # shellWithHoogle = true; diff --git a/lib/Data/Config/Suckless/Parse/Megaparsec.hs b/lib/Data/Config/Suckless/Parse/Megaparsec.hs index da433f7..caf5c92 100644 --- a/lib/Data/Config/Suckless/Parse/Megaparsec.hs +++ b/lib/Data/Config/Suckless/Parse/Megaparsec.hs @@ -161,20 +161,24 @@ parseSyntax :: forall c . MegaConstraints c parseSyntax = parse (merely (syntax sc)) "input" top :: forall c . MegaConstraints c => Parser [Syntax c] -top = sc >> many (topStmt <|> syntax scTop) - -topStmt :: forall c . MegaConstraints c => Parser (Syntax c) -topStmt = do - scTop +top = many $ do + t <- topStmt + sc + pure t +topTerm :: forall c . MegaConstraints c => Parser (Syntax c) +topTerm = do + sc co <- MegaContext . Just <$> getOffset - s0 <- symbol scTop ss <- many (syntax scTop) void eol <|> eof pure $ List co (s0:ss) +topStmt :: forall c . MegaConstraints c => Parser (Syntax c) +topStmt = topTerm <|> syntax scTop + parseTop :: forall c . MegaConstraints c => String -> Either ParseFail [Syntax c]