Skip to content

Commit

Permalink
fix: improve err msg for multiline inline table
Browse files Browse the repository at this point in the history
show "missing curly brace" instead of "missing table key-value separator"
  • Loading branch information
ToruNiina committed Apr 19, 2019
1 parent 789d784 commit 46be054
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion toml/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1406,10 +1406,16 @@ parse_inline_table(location<Container>& loc)
return ok(std::make_pair(
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
{
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 `,`"}}));
}
}
Expand Down

0 comments on commit 46be054

Please sign in to comment.