Clean up some error messages. Don't show the line in the error message

if it's the first line and we're interactive, since then it's obvious
This commit is contained in:
ridiculousfish
2013-12-16 16:52:23 -08:00
parent 0e421ea31d
commit 3e9153d955
6 changed files with 23 additions and 28 deletions

View File

@@ -12,10 +12,10 @@ static bool production_is_empty(const production_t *production)
}
/** Returns a string description of this parse error */
wcstring parse_error_t::describe(const wcstring &src) const
wcstring parse_error_t::describe(const wcstring &src, bool skip_caret) const
{
wcstring result = text;
if (source_start < src.size() && source_start + source_length <= src.size())
if (! skip_caret && source_start < src.size() && source_start + source_length <= src.size())
{
// Locate the beginning of this line of source
size_t line_start = 0;