mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
fix: improve err msg for multiline inline table
show "missing curly brace" instead of "missing table key-value separator"
This commit is contained in:
@@ -1406,10 +1406,16 @@ parse_inline_table(location<Container>& loc)
|
|||||||
return ok(std::make_pair(
|
return ok(std::make_pair(
|
||||||
retval, region<Container>(loc, first, loc.iter())));
|
retval, region<Container>(loc, first, loc.iter())));
|
||||||
}
|
}
|
||||||
|
else if(*loc.iter() == '#' || *loc.iter() == '\r' || *loc.iter() == '\n')
|
||||||
|
{
|
||||||
|
throw syntax_error(format_underline("[error] "
|
||||||
|
"toml::parse_inline_table: missing curly brace `}`",
|
||||||
|
{{std::addressof(loc), "should be `}`"}}));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw syntax_error(format_underline("[error] "
|
throw syntax_error(format_underline("[error] "
|
||||||
"toml:::parse_inline_table: missing table separator `,` ",
|
"toml::parse_inline_table: missing table separator `,` ",
|
||||||
{{std::addressof(loc), "should be `,`"}}));
|
{{std::addressof(loc), "should be `,`"}}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user