simple-nix-0.1.0.4: Simple parsing/pretty printing for Nix expressions

Safe HaskellNone
LanguageHaskell2010

Nix.Parser

Synopsis

Documentation

parse :: Parser a -> Text -> Either ParseError a Source

Given a parser and a string, attempts to parse the string.

spaces :: Parser () Source

Consumes any spaces (not other whitespace).

spaces1 :: Parser () Source

Consumes at least one space (not other whitespace).

sstring :: String -> Parser String Source

Parses the given string and any trailing spaces.

schar :: Char -> Parser Char Source

Parses the given character and any trailing spaces.

lexeme :: Parser a -> Parser a Source

Parses p and any trailing spaces.

pInt :: Parser Int Source

Parses an integer.

keyword :: String -> Parser String Source

Parses the given string. Does not fail if it's a keyword.

pIdentifier :: Parser Text Source

Parses an identifier

notKeyword :: Parser Text -> Parser Text Source

Parses p, but fails if the result is a reserved word.

keywords :: HashSet Text Source

Set of keywords.

operators :: HashSet String Source

Set of operators.

opChars :: [Char] Source

Characters found in operators.

pInterp :: Parser NixString Source

Parses an interpolated string, without parsing quotes.

pInterpMultiLine :: Parser NixString Source

Parses an interpolated string, without parsing quotes. Counts spaces at beginning of lines.

pKwargs :: Parser FuncArgs Source

Gets all of the arguments for a function.

pBinary :: Parser NixExpr Source

Two expressions joined by a binary operator.