Skip to content

Commit

Permalink
Inline Nix parsing regex in float parsing code
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil authored Sep 3, 2024
1 parent 8dfa521 commit 1e3a25c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Nixfmt/Parser/Float.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1e3a25c

Please sign in to comment.