Skip to content

Commit f9c2d52

Browse files
authored
Merge pull request #3191 from masatake/doc--typo-in-role-desc
Minor fix about --role-<LANG>.<KIND> option and cleanups in CPreProcessor
2 parents a668cb1 + 2a303c4 commit f9c2d52

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

docs/man/ctags.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ See "`TAG ENTRIES`_" about fields, kinds, roles, and extras.
735735
In the above example, the prefix is put to ``end`` field which is
736736
newly introduced in Universal Ctags.
737737

738-
``--roles-(<LANG>|all).(<kind>|all)=[+|-][<roles>|*]``
738+
``--roles-(<LANG>|all).(<kind>|*)=[+|-][<roles>|*]``
739739
Specifies a list of kind-specific roles of tags to include in the
740740
output file for a particular language.
741741
*<kind>* specifies the kind where the *<roles>* are defined.

main/options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static optionDescription LongOptionDescription [] = {
337337
{0,0," --put-field-prefix"},
338338
{0,0," Put \"" CTAGS_FIELD_PREFIX "\" as prefix for the name of fields newly introduced in"},
339339
{0,0," universal-ctags."},
340-
{1,0," --roles-(<LANG>|all).(<kind>|all)=[+|-][<roles>|*]"},
340+
{1,0," --roles-(<LANG>|all).(<kind>|*)=[+|-][<roles>|*]"},
341341
{1,0," Enable/disable tag roles for kinds of language <LANG>."},
342342
{0,0," --tag-relative=(yes|no|always|never)"},
343343
{0,0," Should paths be relative to location of tag file [no; yes when -e]?"},

man/ctags.1.rst.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ See "`TAG ENTRIES`_" about fields, kinds, roles, and extras.
735735
In the above example, the prefix is put to ``end`` field which is
736736
newly introduced in Universal Ctags.
737737

738-
``--roles-(<LANG>|all).(<kind>|all)=[+|-][<roles>|*]``
738+
``--roles-(<LANG>|all).(<kind>|*)=[+|-][<roles>|*]``
739739
Specifies a list of kind-specific roles of tags to include in the
740740
output file for a particular language.
741741
*<kind>* specifies the kind where the *<roles>* are defined.

parsers/cpreprocessor.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -826,30 +826,30 @@ static void makeIncludeTag (const char *const name, bool systemHeader)
826826

827827
if (isLanguageRoleEnabled(lang, Cpp.headerKindIndex, role_index))
828828
{
829-
if (doesCPreProRunAsStandaloneParser (CPREPRO_HEADER))
829+
if (standing_alone)
830830
pushLanguage (Cpp.lang);
831831

832832
initRefTagEntry (&e, name, Cpp.headerKindIndex, role_index);
833833
e.isFileScope = false;
834834
e.truncateLineAfterTag = true;
835835
makeTagEntry (&e);
836836

837-
if (doesCPreProRunAsStandaloneParser (CPREPRO_HEADER))
837+
if (standing_alone)
838838
popLanguage ();
839839
}
840840
}
841841

842842
static void makeParamTag (vString *name, short nth, bool placeholder)
843843
{
844844
bool standing_alone = doesCPreProRunAsStandaloneParser(CPREPRO_MACRO);
845-
langType lang = standing_alone ? Cpp.lang: Cpp.clientLang;
846845

847846
Assert (Cpp.macroParamKindIndex != KIND_GHOST_INDEX);
848847

849-
int r;
850-
pushLanguage (lang);
851-
r = makeSimpleTag (name, Cpp.macroParamKindIndex);
852-
popLanguage ();
848+
if (standing_alone)
849+
pushLanguage (Cpp.lang);
850+
int r = makeSimpleTag (name, Cpp.macroParamKindIndex);
851+
if (standing_alone)
852+
popLanguage ();
853853

854854
tagEntryInfo *e = getEntryInCorkQueue (r);
855855
if (e)
@@ -1076,8 +1076,8 @@ static bool handleDirective (const int c, int *macroCorkIndex)
10761076
case DRCTV_HASH: ignore = directiveHash (c); break;
10771077
case DRCTV_IF: ignore = directiveIf (c); break;
10781078
case DRCTV_PRAGMA: directivePragma (c); break;
1079-
case DRCTV_UNDEF: directiveUndef (c); break;
1080-
case DRCTV_INCLUDE: directiveInclude (c); break;
1079+
case DRCTV_UNDEF: directiveUndef (c); break;
1080+
case DRCTV_INCLUDE: directiveInclude (c); break;
10811081
}
10821082
return ignore;
10831083
}

0 commit comments

Comments
 (0)