Skip to content

Commit

Permalink
main: report the char when an acceptable char is given as a part of a…
Browse files Browse the repository at this point in the history
… role, extra, or field name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Aug 30, 2024
1 parent f67d638 commit fd781c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Tmain/broken-extradef.d/stderr-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ctags: no extra definition specified in "--_extradef-IMAGINARY" option
# wrong char in a field name
ctags: no extra description specified in "--_extradef-IMAGINARY" option
ctags: no extra description specified in "--_extradef-IMAGINARY" option
ctags: unacceptable char as part of extra name in "--_extradef-IMAGINARY" option
ctags: unacceptable char as part of extra name in "--_extradef-IMAGINARY" option
ctags: unacceptable char as part of extra name in "--_extradef-IMAGINARY" option: ':'
ctags: unacceptable char as part of extra name in "--_extradef-IMAGINARY" option: ':'

# empty extra name
ctags: the extra name in "--_extradef-IMAGINARY" option is empty
Expand Down
4 changes: 2 additions & 2 deletions Tmain/broken-fielddef.d/stderr-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ctags: no field definition specified in "--_fielddef-IMAGINARY" option
# wrong char in a field name
ctags: no field description specified in "--_fielddef-IMAGINARY" option
ctags: no field description specified in "--_fielddef-IMAGINARY" option
ctags: unacceptable char as part of field name in "--_fielddef-IMAGINARY" option
ctags: unacceptable char as part of field name in "--_fielddef-IMAGINARY" option
ctags: unacceptable char as part of field name in "--_fielddef-IMAGINARY" option: ':'
ctags: unacceptable char as part of field name in "--_fielddef-IMAGINARY" option: ':'

# empty field name
ctags: the field name in "--_fielddef-IMAGINARY" option is empty
Expand Down
4 changes: 2 additions & 2 deletions Tmain/roledef.d/stderr-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ ctags: the role name in "--_roledef-IMAGINARY.{variable}" option is empty
ctags: the role name in "--_roledef-IMAGINARY.{variable}" option is empty

# wrong char in role name
ctags: unacceptable char as part of role name in "--_roledef-IMAGINARY.v" option: +
ctags: unacceptable char as part of role name in "--_roledef-IMAGINARY.{variable}" option: +
ctags: unacceptable char as part of role name in "--_roledef-IMAGINARY.v" option: '+'
ctags: unacceptable char as part of role name in "--_roledef-IMAGINARY.{variable}" option: '+'

# empty description
ctags: no role description specified in "--_roledef-IMAGINARY.v" option
Expand Down
14 changes: 7 additions & 7 deletions main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2868,7 +2868,7 @@ static bool processLangDefineRole(const langType language,
while (p != tmp_end)
{
if (!isalnum ((unsigned char) *p))
error (FATAL, "unacceptable char as part of role name in \"--%s\" option: %c",
error (FATAL, "unacceptable char as part of role name in \"--%s\" option: '%c'",
option, *p);
p++;
}
Expand Down Expand Up @@ -3553,8 +3553,8 @@ static bool processLangDefineParam (const langType language,
for (; p < name_end; p++)
{
if (!isalnum ((unsigned char) *p) && *p != '_')
error (FATAL, "unacceptable char as part of extra name in \"--%s\" option",
option);
error (FATAL, "unacceptable char as part of extra name in \"--%s\" option: '%c'",
option, *p);
}

p++;
Expand Down Expand Up @@ -3959,8 +3959,8 @@ static bool processLangDefineExtra (const langType language,
for (; p < name_end; p++)
{
if (!isalnum ((unsigned char) *p))
error (FATAL, "unacceptable char as part of extra name in \"--%s\" option",
option);
error (FATAL, "unacceptable char as part of extra name in \"--%s\" option: '%c'",
option, *p);
}

p++;
Expand Down Expand Up @@ -4028,8 +4028,8 @@ static bool processLangDefineField (const langType language,
for (; p < name_end; p++)
{
if (!isalpha ((unsigned char) *p))
error (FATAL, "unacceptable char as part of field name in \"--%s\" option",
option);
error (FATAL, "unacceptable char as part of field name in \"--%s\" option: '%c'",
option, *p);
}

p++;
Expand Down

0 comments on commit fd781c1

Please sign in to comment.