floatLiteral method
Implementation
Parser<ConstantNode> floatLiteral() =>
[
// Point followed by digits
char('.') &
(digit() | char('_')).plus() &
ref0(exponentPart).optional(),
// Digits with fraction and optional exponent
(digit() | char('_')).plus() &
((char('.') &
(digit() | char('_')).star() &
ref0(exponentPart).optional()) |
ref0(exponentPart)),
].toChoiceParser().flatten().map(
(s) => ConstantNode(double.parse(s.replaceAll('_', ''))),
);