From 1e3a25c495ab9864a57268abc731aca56be6d0ab Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 3 Sep 2024 20:15:05 +0200 Subject: [PATCH] Inline Nix parsing regex in float parsing code --- src/Nixfmt/Parser/Float.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Nixfmt/Parser/Float.hs b/src/Nixfmt/Parser/Float.hs index 42b0f5f..b6658df 100644 --- a/src/Nixfmt/Parser/Float.hs +++ b/src/Nixfmt/Parser/Float.hs @@ -19,7 +19,8 @@ import Text.Megaparsec.Char (char, digitChar) floatParse :: (MonadParsec e s m, Token s ~ Char, Semigroup (m [Char])) => m Text floatParse = - -- This mirrors https://github.com/NixOS/nix/blob/b89eca9aecc69d4dfc0f0afd9353c126eb7b5858/src/libexpr/lexer.l#L96 + -- This mirrors https://github.com/NixOS/nix/blob/b89eca9aecc69d4dfc0f0afd9353c126eb7b5858/src/libexpr/lexer.l#L96: + -- (([1-9][0-9]*\.[0-9]*)|(0?\.[0-9]+))([Ee][+-]?[0-9]+)? pack <$> ( ( try oneThroughNineStart <|> zeroDotStart