fix: improve err msg for multiline inline table

show "missing curly brace" instead of "missing table key-value separator"
This commit is contained in:
ToruNiina
2019-04-19 13:22:13 +09:00
parent 789d784769
commit 46be054ce9

View File

@@ -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 `,`"}}));
} }
} }