Mark error messages more consistent

Always include English name of a mentioned character.
This commit is contained in:
Olly Betts 2022-02-25 10:07:17 +13:00
commit 7f37bfe2b5
7 changed files with 12 additions and 12 deletions

View file

@ -1 +1 @@
c_extra_rbrace.i:5: Error: Syntax error. Extraneous '}' c_extra_rbrace.i:5: Error: Syntax error. Extraneous closing brace ('}')

View file

@ -1 +1 @@
c_missing_semi.i:3: Error: Syntax error - possibly a missing semicolon. c_missing_semi.i:3: Error: Syntax error - possibly a missing semicolon (';').

View file

@ -1 +1 @@
cpp_extra_brackets.i:5: Error: Unexpected ')'. cpp_extra_brackets.i:5: Error: Unexpected closing parenthesis (')').

View file

@ -1 +1 @@
doxygen_unclosed_tag.i:4: Warning 563: Doxygen HTML error for tag b: HTML tag without '>' found. doxygen_unclosed_tag.i:4: Warning 563: Doxygen HTML error for tag b: HTML tag without greater-than ('>') found.

View file

@ -214,13 +214,13 @@ void skip_decl(void) {
tok = Scanner_token(scan); tok = Scanner_token(scan);
if (tok == 0) { if (tok == 0) {
if (!Swig_error_count()) { if (!Swig_error_count()) {
Swig_error(cparse_file, start_line, "Missing semicolon. Reached end of input.\n"); Swig_error(cparse_file, start_line, "Missing semicolon (';'). Reached end of input.\n");
} }
return; return;
} }
if (tok == SWIG_TOKEN_LBRACE) { if (tok == SWIG_TOKEN_LBRACE) {
if (Scanner_skip_balanced(scan,'{','}') < 0) { if (Scanner_skip_balanced(scan,'{','}') < 0) {
Swig_error(cparse_file, start_line, "Missing '}'. Reached end of input.\n"); Swig_error(cparse_file, start_line, "Missing closing brace ('}'). Reached end of input.\n");
} }
break; break;
} }
@ -267,7 +267,7 @@ static int yylook(void) {
case SWIG_TOKEN_RBRACE: case SWIG_TOKEN_RBRACE:
num_brace--; num_brace--;
if (num_brace < 0) { if (num_brace < 0) {
Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous '}'\n"); Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous closing brace ('}')\n");
num_brace = 0; num_brace = 0;
} else { } else {
return RBRACE; return RBRACE;

View file

@ -2014,7 +2014,7 @@ constant_directive : CONSTANT identifier EQUAL definetype SEMI {
$$ = 0; $$ = 0;
} }
| CONSTANT error END { | CONSTANT error END {
Swig_error(cparse_file,cparse_line,"Missing ';' after %%constant.\n"); Swig_error(cparse_file,cparse_line,"Missing semicolon (';') after %%constant.\n");
SWIG_exit(EXIT_FAILURE); SWIG_exit(EXIT_FAILURE);
} }
; ;
@ -3371,9 +3371,9 @@ c_decl_tail : SEMI {
| error { | error {
$$ = 0; $$ = 0;
if (yychar == RPAREN) { if (yychar == RPAREN) {
Swig_error(cparse_file, cparse_line, "Unexpected ')'.\n"); Swig_error(cparse_file, cparse_line, "Unexpected closing parenthesis (')').\n");
} else { } else {
Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon.\n"); Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon (';').\n");
} }
SWIG_exit(EXIT_FAILURE); SWIG_exit(EXIT_FAILURE);
} }

View file

@ -1249,13 +1249,13 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line) {
// for example <A ...>, <IMG ...>, ... // for example <A ...>, <IMG ...>, ...
if (isEndHtmlTag) { if (isEndHtmlTag) {
m_tokenListIt = m_tokenList.end(); m_tokenListIt = m_tokenList.end();
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": Illegal end HTML tag without '>' found."); printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": Illegal end HTML tag without greater-than ('>') found.");
} }
endHtmlPos = line.find(">", pos); endHtmlPos = line.find(">", pos);
if (endHtmlPos == string::npos) { if (endHtmlPos == string::npos) {
m_tokenListIt = m_tokenList.end(); m_tokenListIt = m_tokenList.end();
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": HTML tag without '>' found."); printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": HTML tag without greater-than ('>') found.");
} }
// add args of HTML command, like link URL, image URL, ... // add args of HTML command, like link URL, image URL, ...
m_tokenList.push_back(Token(PLAINSTRING, line.substr(pos, endHtmlPos - pos))); m_tokenList.push_back(Token(PLAINSTRING, line.substr(pos, endHtmlPos - pos)));