not-fl3 / nanoserde

Serialisation library with zero dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TomlParser doesn't allow keys with `0-9` in them

fpdotmonkey opened this issue · comments

According to the TOML spec, this should be a valid TOML file

[thing]
1234 = "value"

If I parse it with nanoserde's TOML parser,

nanoserde::TomlParser::parse("[thing]\n1234 = \"value\"");

you get an error

Toml error: Unexpected token U64(1234) , line:2 col:1

Critically, a key with any [0-9] characters in it causes an error; MyThing1 = "value" leads to Toml error: Unexpected token U64(1) , line:2 col:1.