Support parsing float literals in Bergamot

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2023-12-26 13:08:09 -08:00
parent 29a95d2659
commit 4c12fee4aa

View File

@ -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
])