If you want to disable literals like .123 (like in Elm) you could write
something like this:
elmFloat : ParserFloat elmFloat = oneOf [ symbol"." |. problem"floating point numbers must start with a digit, like 0.25" , float ]
Note: If you want a parser for both Int and Float literals, check out
number below. It will be faster than using oneOf to combining
int and float yourself.
Parse floats.
Remarks
Example
If you want to disable literals like
.123
(like in Elm) you could write something like this:Note: If you want a parser for both
Int
andFloat
literals, check out number below. It will be faster than usingoneOf
to combiningint
andfloat
yourself.