Skip to content

Commit 9a7f07c

Browse files
committed
Parser: m refactor
1 parent 47b1f03 commit 9a7f07c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Nix/Parser.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ import Text.Megaparsec.Char ( space1
105105
, letterChar
106106
, char
107107
)
108-
import qualified Text.Megaparsec.Char.Lexer as L
108+
import qualified Text.Megaparsec.Char.Lexer as Lexer
109109

110110
infixl 3 <+>
111111
(<+>) :: MonadPlus m => m a -> m a -> m a
@@ -199,7 +199,8 @@ nixTerm = do
199199

200200
nixToplevelForm :: Parser NExprLoc
201201
nixToplevelForm = keywords <+> nixLambda <+> nixExpr
202-
where keywords = nixLet <+> nixIf <+> nixAssert <+> nixWith
202+
where
203+
keywords = nixLet <+> nixIf <+> nixAssert <+> nixWith
203204

204205
nixSym :: Parser NExprLoc
205206
nixSym = annotateLocation1 $ mkSymF <$> identifier
@@ -503,10 +504,10 @@ skipLineComment' prefix =
503504
whiteSpace :: Parser ()
504505
whiteSpace = do
505506
put =<< getSourcePos
506-
L.space space1 lineCmnt blockCmnt
507+
Lexer.space space1 lineCmnt blockCmnt
507508
where
508509
lineCmnt = skipLineComment' "#"
509-
blockCmnt = L.skipBlockComment "/*" "*/"
510+
blockCmnt = Lexer.skipBlockComment "/*" "*/"
510511

511512
lexeme :: Parser a -> Parser a
512513
lexeme p = p <* whiteSpace
@@ -552,10 +553,10 @@ equals = symbol "="
552553
question = symbol "?"
553554

554555
integer :: Parser Integer
555-
integer = lexeme L.decimal
556+
integer = lexeme Lexer.decimal
556557

557558
float :: Parser Double
558-
float = lexeme L.float
559+
float = lexeme Lexer.float
559560

560561
reservedNames :: HashSet Text
561562
reservedNames =

0 commit comments

Comments
 (0)