Skip to content

Commit 05686f9

Browse files
committed
Parser: nixExpr(->Algebra) (name was mesleading & colliding)
1 parent 4751965 commit 05686f9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Nix/Parser.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Nix.Parser
2222
, getBinaryOperator
2323
, getSpecialOperator
2424
, nixTopLevelForm
25-
, nixExpr
25+
, nixExprAlgebra
2626
, nixSet
2727
, nixBinders
2828
, nixSelector
@@ -739,9 +739,9 @@ nixIf :: Parser NExprLoc
739739
nixIf =
740740
annotateNamedLocation "if" $
741741
liftA3 NIf
742-
(reserved "if" *> nixExpr )
743-
(getExprAfterReservedWord "then")
744-
(getExprAfterReservedWord "else")
742+
(reserved "if" *> nixExprAlgebra)
743+
(getExprAfterReservedWord "then" )
744+
(getExprAfterReservedWord "else" )
745745

746746
-- ** with
747747

@@ -848,15 +848,15 @@ nixTerm = do
848848

849849
-- | Nix expression algebra parser.
850850
-- "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.
851-
nixExpr :: Parser NExprLoc
852-
nixExpr =
851+
nixExprAlgebra :: Parser NExprLoc
852+
nixExprAlgebra =
853853
makeExprParser
854854
nixTerm $
855855
snd <<$>>
856856
nixOperators nixSelector
857857

858858
nixTopLevelForm :: Parser NExprLoc
859-
nixTopLevelForm = keywords <|> nixLambda <|> nixExpr
859+
nixTopLevelForm = keywords <|> nixLambda <|> nixExprAlgebra
860860
where
861861
keywords = nixLet <|> nixIf <|> nixAssert <|> nixWith
862862

0 commit comments

Comments
 (0)