nixfmt-0.6.0: An opinionated formatter for Nix
Safe HaskellSafe-Inferred
LanguageHaskell2010

Nixfmt.Parser

Synopsis

Documentation

ann :: (a -> b) -> Parser a -> Parser (Ann b) Source #

rawSymbol :: Token -> Parser Token Source #

parses a token without parsing trivia after it

fixFirstLine :: [[StringPart]] -> [[StringPart]] Source #

Drop the first line of a string if it is empty.

fixLastLine :: [[StringPart]] -> [[StringPart]] Source #

Empty the last line if it contains only spaces.

splitLines :: [StringPart] -> [[StringPart]] Source #

Split a list of StringParts on the newlines in their TextParts. Invariant: result is never empty.