Skip to content

Numbers with leading zero #333

@dariodsa

Description

@dariodsa

Currently tomland interprets decimal numbers with leading zeros into zero. That is not really in the spirit of a TOML-0.5.0. According to the documentation:

Leading zeros are not allowed. Integer values -0 and +0 are valid and identical to an unprefixed zero.

For this behaviour is responsible zero parser in function decimalP.

zero, more :: Parser Integer
zero = 0 <$ char '0'

So the type of parser should allow leading zero only if it is the only digit in the number, otherwise it shouldn't be allowed to come first.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingparserEverything related to `Text -> Toml`

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions