From 4c12fee4aadb4698356b63597ccdf5e1accece1e Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 26 Dec 2023 13:08:09 -0800 Subject: [PATCH] Support parsing float literals in Bergamot Signed-off-by: Danila Fedorin --- src/Bergamot/Parser.elm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Bergamot/Parser.elm b/src/Bergamot/Parser.elm index 01467ab..09933e9 100644 --- a/src/Bergamot/Parser.elm +++ b/src/Bergamot/Parser.elm @@ -10,9 +10,6 @@ import Set exposing (Set) reserved : Set String reserved = Set.fromList ["section"] -intLit : Parser Int -intLit = Parser.int - strLit : Parser String strLit = let @@ -78,7 +75,13 @@ term = Parser.lazy (\() -> Parser.oneOf |= name , Parser.backtrackable <| Parser.succeed Var |= variable - , Parser.succeed IntLit |= intLit + , Parser.number + { int = Just IntLit + , hex = Nothing + , octal = Nothing + , binary = Nothing + , float = Just FloatLit + } , Parser.succeed StringLit |= strLit ])