Skip to content

Commit

Permalink
Cxx: don't set "nth:" fields in upper layers of parsers
Browse files Browse the repository at this point in the history
The lower layer of tagging sets the fields.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Nov 30, 2022
1 parent 8707721 commit b9249a8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion parsers/cxx/cxx_parser_function.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,6 @@ void cxxParserEmitFunctionParameterTags(CXXTypedVariableSet * pInfo)
} else {
pTypeName = NULL;
}
tag->extensionFields.nth = i;

tag->isFileScope = true;

Expand Down
2 changes: 0 additions & 2 deletions parsers/cxx/cxx_parser_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,6 @@ void cxxParserEmitTemplateParameterTags(void)
if(!tag)
continue;

tag->extensionFields.nth = (short)i;

CXXToken * pTypeToken = cxxTagCheckAndSetTypeField(
g_cxx.oTemplateParameters.aTypeStarts[i],
g_cxx.oTemplateParameters.aTypeEnds[i]
Expand Down
3 changes: 2 additions & 1 deletion parsers/cxx/cxx_parser_typedef.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ void cxxParserExtractTypedef(
if(bGotTemplate)
cxxTagHandleTemplateFields();

cxxTagCommit(NULL);
int iCorkQueueIndex = cxxTagCommit(NULL);
cxxTagUseTokenAsPartOfDefTag(iCorkQueueIndex, t);

if (
bGotTemplate &&
Expand Down
1 change: 1 addition & 0 deletions parsers/cxx/cxx_parser_variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ bool cxxParserExtractVariableDeclarations(CXXTokenChain * pChain,unsigned int uF
cxxTagHandleTemplateFields();

iCorkIndex = cxxTagCommit(&iCorkIndexFQ);
cxxTagUseTokenAsPartOfDefTag(iCorkIndexFQ, pIdentifier);

if(pTypeToken)
cxxTokenDestroy(pTypeToken);
Expand Down
3 changes: 2 additions & 1 deletion parsers/cxx/cxx_tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ tagEntryInfo * cxxTagBegin(unsigned int uKind,CXXToken * pToken)
g_oCXXTag.extensionFields.scopeIndex = cxxScopeGetDefTag();
if (g_oCXXTag.extensionFields.scopeIndex != CORK_NIL)
{
if (uKind == CXXTagKindMEMBER || uKind == CXXTagKindENUMERATOR)
if (uKind == CXXTagKindMEMBER || uKind == CXXTagKindENUMERATOR
|| uKind == CXXTagKindPARAMETER || CXXTagCPPKindTEMPLATEPARAM)
g_oCXXTag.extensionFields.nth =
(short) countEntriesInScope(g_oCXXTag.extensionFields.scopeIndex,
true,
Expand Down

0 comments on commit b9249a8

Please sign in to comment.