Skip to content

Commit b9249a8

Browse files
committed
Cxx: don't set "nth:" fields in upper layers of parsers
The lower layer of tagging sets the fields. Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 8707721 commit b9249a8

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

parsers/cxx/cxx_parser_function.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,6 @@ void cxxParserEmitFunctionParameterTags(CXXTypedVariableSet * pInfo)
19251925
} else {
19261926
pTypeName = NULL;
19271927
}
1928-
tag->extensionFields.nth = i;
19291928

19301929
tag->isFileScope = true;
19311930

parsers/cxx/cxx_parser_template.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,6 @@ void cxxParserEmitTemplateParameterTags(void)
823823
if(!tag)
824824
continue;
825825

826-
tag->extensionFields.nth = (short)i;
827-
828826
CXXToken * pTypeToken = cxxTagCheckAndSetTypeField(
829827
g_cxx.oTemplateParameters.aTypeStarts[i],
830828
g_cxx.oTemplateParameters.aTypeEnds[i]

parsers/cxx/cxx_parser_typedef.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ void cxxParserExtractTypedef(
442442
if(bGotTemplate)
443443
cxxTagHandleTemplateFields();
444444

445-
cxxTagCommit(NULL);
445+
int iCorkQueueIndex = cxxTagCommit(NULL);
446+
cxxTagUseTokenAsPartOfDefTag(iCorkQueueIndex, t);
446447

447448
if (
448449
bGotTemplate &&

parsers/cxx/cxx_parser_variable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ bool cxxParserExtractVariableDeclarations(CXXTokenChain * pChain,unsigned int uF
767767
cxxTagHandleTemplateFields();
768768

769769
iCorkIndex = cxxTagCommit(&iCorkIndexFQ);
770+
cxxTagUseTokenAsPartOfDefTag(iCorkIndexFQ, pIdentifier);
770771

771772
if(pTypeToken)
772773
cxxTokenDestroy(pTypeToken);

parsers/cxx/cxx_tag.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ tagEntryInfo * cxxTagBegin(unsigned int uKind,CXXToken * pToken)
298298
g_oCXXTag.extensionFields.scopeIndex = cxxScopeGetDefTag();
299299
if (g_oCXXTag.extensionFields.scopeIndex != CORK_NIL)
300300
{
301-
if (uKind == CXXTagKindMEMBER || uKind == CXXTagKindENUMERATOR)
301+
if (uKind == CXXTagKindMEMBER || uKind == CXXTagKindENUMERATOR
302+
|| uKind == CXXTagKindPARAMETER || CXXTagCPPKindTEMPLATEPARAM)
302303
g_oCXXTag.extensionFields.nth =
303304
(short) countEntriesInScope(g_oCXXTag.extensionFields.scopeIndex,
304305
true,

0 commit comments

Comments
 (0)