Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Main module for parsing Nix expressions.
Synopsis
- parseNixFile :: MonadFile m => Path -> m (Result NExpr)
- parseNixFileLoc :: MonadFile m => Path -> m (Result NExprLoc)
- parseNixText :: Text -> Result NExpr
- parseNixTextLoc :: Text -> Result NExprLoc
- parseExpr :: MonadFail m => Text -> m NExpr
- parseFromFileEx :: MonadFile m => Parser a -> Path -> m (Result a)
- type Parser = ParsecT Void Text (State SourcePos)
- parseFromText :: Parser a -> Text -> Result a
- type Result a = Either (Doc Void) a
- reservedNames :: HashSet VarName
- data NAssoc
- newtype NOpPrecedence = NOpPrecedence Int
- newtype NOpName = NOpName Text
- data NSpecialOp
- = NHasAttrOp
- | NSelectOp
- | NTerm
- data NOperatorDef
- nixExpr :: Parser NExprLoc
- nixExprAlgebra :: Parser NExprLoc
- nixSet :: Parser NExprLoc
- nixBinders :: Parser [Binding NExprLoc]
- nixSelector :: Parser (AnnUnit SrcSpan (NAttrPath NExprLoc))
- nixSym :: Parser NExprLoc
- nixPath :: Parser NExprLoc
- nixString :: Parser NExprLoc
- nixUri :: Parser NExprLoc
- nixSearchPath :: Parser NExprLoc
- nixFloat :: Parser NExprLoc
- nixInt :: Parser NExprLoc
- nixBool :: Parser NExprLoc
- nixNull :: Parser NExprLoc
- whiteSpace :: Parser ()
- class NOp a where
- getOpDef :: a -> NOperatorDef
- getOpAssoc :: a -> NAssoc
- getOpPrecedence :: a -> NOpPrecedence
- getOpName :: a -> NOpName
- appOpDef :: NOperatorDef
Documentation
NAssocLeft | |
NAssoc | Bidirectional associativity, or simply: associative property. |
NAssocRight |
Instances
Data NAssoc Source # | |
Defined in Nix.Parser gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NAssoc -> c NAssoc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NAssoc # toConstr :: NAssoc -> Constr # dataTypeOf :: NAssoc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NAssoc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NAssoc) # gmapT :: (forall b. Data b => b -> b) -> NAssoc -> NAssoc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NAssoc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NAssoc -> r # gmapQ :: (forall d. Data d => d -> u) -> NAssoc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NAssoc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NAssoc -> m NAssoc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NAssoc -> m NAssoc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NAssoc -> m NAssoc # | |
Generic NAssoc Source # | |
Show NAssoc Source # | |
NFData NAssoc Source # | |
Defined in Nix.Parser | |
Eq NAssoc Source # | |
Ord NAssoc Source # | |
type Rep NAssoc Source # | |
Defined in Nix.Parser type Rep NAssoc = D1 ('MetaData "NAssoc" "Nix.Parser" "hnix-0.17.0-8saIMbclRB9HPH4JCEpCXn" 'False) (C1 ('MetaCons "NAssocLeft" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NAssocRight" 'PrefixI 'False) (U1 :: Type -> Type))) |
newtype NOpPrecedence Source #
Instances
Instances
Data NOpName Source # | |
Defined in Nix.Parser gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NOpName -> c NOpName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NOpName # toConstr :: NOpName -> Constr # dataTypeOf :: NOpName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NOpName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NOpName) # gmapT :: (forall b. Data b => b -> b) -> NOpName -> NOpName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NOpName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NOpName -> r # gmapQ :: (forall d. Data d => d -> u) -> NOpName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NOpName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NOpName -> m NOpName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NOpName -> m NOpName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NOpName -> m NOpName # | |
IsString NOpName Source # | |
Defined in Nix.Parser fromString :: String -> NOpName # | |
Generic NOpName Source # | |
Show NOpName Source # | |
NFData NOpName Source # | |
Defined in Nix.Parser | |
Eq NOpName Source # | |
Ord NOpName Source # | |
ToString NOpName Source # | |
Defined in Nix.Parser | |
type Rep NOpName Source # | |
Defined in Nix.Parser |
data NSpecialOp Source #
NHasAttrOp | |
NSelectOp | |
NTerm | For special handling of internal special cases. |
Instances
data NOperatorDef Source #
Single operator grammar entries.
NAppDef NAppOp NAssoc NOpPrecedence NOpName | |
NUnaryDef NUnaryOp NAssoc NOpPrecedence NOpName | |
NBinaryDef NBinaryOp NAssoc NOpPrecedence NOpName | |
NSpecialDef NSpecialOp NAssoc NOpPrecedence NOpName |
Instances
nixExprAlgebra :: Parser NExprLoc Source #
Nix expression algebra parser.
"Expression algebra" is to explain megaparsec
use of the term Expression (parser for language algebraic coperators without any statements (without let
etc.)), which is essentially an algebra inside the language.
nixSearchPath :: Parser NExprLoc Source #
A path surrounded by angle brackets, indicating that it should be looked up in the NIX_PATH environment variable at evaluation.
whiteSpace :: Parser () Source #
Class to get a private free construction to abstract away the gap between the Nix operation types
NUnaryOp
, NBinaryOp
, NSpecialOp
.
And in doing remove OperatorInfo
from existance.
getOpDef :: a -> NOperatorDef Source #
getOpAssoc :: a -> NAssoc Source #
getOpPrecedence :: a -> NOpPrecedence Source #
Instances
NOp NBinaryOp Source # | |
Defined in Nix.Parser getOpDef :: NBinaryOp -> NOperatorDef Source # getOpAssoc :: NBinaryOp -> NAssoc Source # | |
NOp NUnaryOp Source # | |
Defined in Nix.Parser getOpDef :: NUnaryOp -> NOperatorDef Source # getOpAssoc :: NUnaryOp -> NAssoc Source # | |
NOp NOperatorDef Source # | |
Defined in Nix.Parser getOpDef :: NOperatorDef -> NOperatorDef Source # getOpAssoc :: NOperatorDef -> NAssoc Source # getOpPrecedence :: NOperatorDef -> NOpPrecedence Source # getOpName :: NOperatorDef -> NOpName Source # | |
NOp NSpecialOp Source # | |
Defined in Nix.Parser getOpDef :: NSpecialOp -> NOperatorDef Source # getOpAssoc :: NSpecialOp -> NAssoc Source # getOpPrecedence :: NSpecialOp -> NOpPrecedence Source # getOpName :: NSpecialOp -> NOpName Source # |
appOpDef :: NOperatorDef Source #
Functional application operator definition, left associative, high precedence.