Skip to content

Commit 7f37bfe

Browse files
committed
Mark error messages more consistent
Always include English name of a mentioned character.
1 parent d22b7df commit 7f37bfe

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c_extra_rbrace.i:5: Error: Syntax error. Extraneous '}'
1+
c_extra_rbrace.i:5: Error: Syntax error. Extraneous closing brace ('}')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c_missing_semi.i:3: Error: Syntax error - possibly a missing semicolon.
1+
c_missing_semi.i:3: Error: Syntax error - possibly a missing semicolon (';').
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cpp_extra_brackets.i:5: Error: Unexpected ')'.
1+
cpp_extra_brackets.i:5: Error: Unexpected closing parenthesis (')').
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
doxygen_unclosed_tag.i:4: Warning 563: Doxygen HTML error for tag b: HTML tag without '>' found.
1+
doxygen_unclosed_tag.i:4: Warning 563: Doxygen HTML error for tag b: HTML tag without greater-than ('>') found.

Source/CParse/cscanner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ void skip_decl(void) {
214214
tok = Scanner_token(scan);
215215
if (tok == 0) {
216216
if (!Swig_error_count()) {
217-
Swig_error(cparse_file, start_line, "Missing semicolon. Reached end of input.\n");
217+
Swig_error(cparse_file, start_line, "Missing semicolon (';'). Reached end of input.\n");
218218
}
219219
return;
220220
}
221221
if (tok == SWIG_TOKEN_LBRACE) {
222222
if (Scanner_skip_balanced(scan,'{','}') < 0) {
223-
Swig_error(cparse_file, start_line, "Missing '}'. Reached end of input.\n");
223+
Swig_error(cparse_file, start_line, "Missing closing brace ('}'). Reached end of input.\n");
224224
}
225225
break;
226226
}
@@ -267,7 +267,7 @@ static int yylook(void) {
267267
case SWIG_TOKEN_RBRACE:
268268
num_brace--;
269269
if (num_brace < 0) {
270-
Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous '}'\n");
270+
Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous closing brace ('}')\n");
271271
num_brace = 0;
272272
} else {
273273
return RBRACE;

Source/CParse/parser.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ constant_directive : CONSTANT identifier EQUAL definetype SEMI {
20142014
$$ = 0;
20152015
}
20162016
| CONSTANT error END {
2017-
Swig_error(cparse_file,cparse_line,"Missing ';' after %%constant.\n");
2017+
Swig_error(cparse_file,cparse_line,"Missing semicolon (';') after %%constant.\n");
20182018
SWIG_exit(EXIT_FAILURE);
20192019
}
20202020
;
@@ -3371,9 +3371,9 @@ c_decl_tail : SEMI {
33713371
| error {
33723372
$$ = 0;
33733373
if (yychar == RPAREN) {
3374-
Swig_error(cparse_file, cparse_line, "Unexpected ')'.\n");
3374+
Swig_error(cparse_file, cparse_line, "Unexpected closing parenthesis (')').\n");
33753375
} else {
3376-
Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon.\n");
3376+
Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon (';').\n");
33773377
}
33783378
SWIG_exit(EXIT_FAILURE);
33793379
}

Source/Doxygen/doxyparser.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,13 +1249,13 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line) {
12491249
// for example <A ...>, <IMG ...>, ...
12501250
if (isEndHtmlTag) {
12511251
m_tokenListIt = m_tokenList.end();
1252-
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": Illegal end HTML tag without '>' found.");
1252+
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": Illegal end HTML tag without greater-than ('>') found.");
12531253
}
12541254

12551255
endHtmlPos = line.find(">", pos);
12561256
if (endHtmlPos == string::npos) {
12571257
m_tokenListIt = m_tokenList.end();
1258-
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": HTML tag without '>' found.");
1258+
printListError(WARN_DOXYGEN_HTML_ERROR, "Doxygen HTML error for tag " + cmd + ": HTML tag without greater-than ('>') found.");
12591259
}
12601260
// add args of HTML command, like link URL, image URL, ...
12611261
m_tokenList.push_back(Token(PLAINSTRING, line.substr(pos, endHtmlPos - pos)));

0 commit comments

Comments
 (0)