-
-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
toml++ version and/or commit hash:
toml++ v2.5.0 037bfdd
Compiler:
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
C++ standard mode:
17
Target arch:
x86
Library configuration overrides:
Relevant compilation flags:
Describe the bug
If the table was created earlier, then the redefinition error is not called
Steps to reproduce (or a small repro code sample)
This is parsed without error:
[a.b.c.d]
u = 6
[a]
b.t = 8
[a.b]
u = 0Result:
[a.b]
t = 8
u = 0
[a.b.c.d]
u = 6But this is with an error:
[a]
b.t = 8
[a.b]
u = 0Result:
terminate called after throwing an instance of 'toml::v2::ex::parse_error'
what(): Error while parsing table header: cannot redefine existing table 'a.b'Additional information
For example with tomli (Python):
>>> tomli.loads("""
... [a.b.c.d]
... u = 6
... [a]
... b.t = 8
... [a.b]
... u = 0""")
Traceback (most recent call last):
...
tomli._parser.TOMLDecodeError: Can not declare ('a', 'b') twice (at line 6, column 5)
>>> tomli.loads("""[a]
... b.t = 8
... [a.b]
... u = 0""")
Traceback (most recent call last):
...
tomli._parser.TOMLDecodeError: Can not declare ('a', 'b') twice (at line 3, column 5)Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working