Skip to content

Commit 72ca31a

Browse files
committed
CTagsSelfTes: skip printing broken ptags
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 4099472 commit 72ca31a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

main/parse.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ static kindDefinition defaultFileKind = {
162162
.description = KIND_FILE_DEFAULT_NAME,
163163
};
164164

165+
static langType ctagsSelfTestLang;
166+
165167
/*
166168
* FUNCTION DEFINITIONS
167169
*/
@@ -4719,6 +4721,13 @@ extern bool makeKindDescriptionsPseudoTags (const langType language,
47194721
continue;
47204722

47214723
kind = getKind (kcb, i);
4724+
if (language == ctagsSelfTestLang
4725+
&& (kind == NULL || kind->name == NULL))
4726+
{
4727+
/* The Self test parser may have broken kinds.
4728+
* Let's skip it. */
4729+
continue;
4730+
}
47224731
makeKindDescriptionPseudoTag (kind, &data);
47234732
}
47244733

@@ -5588,6 +5597,11 @@ static void printStatsCTST (langType lang CTAGS_ATTR_UNUSED)
55885597
CTST_num_handled_char);
55895598
}
55905599

5600+
static void initCTST (langType language)
5601+
{
5602+
ctagsSelfTestLang = language;
5603+
}
5604+
55915605
static parserDefinition *CTagsSelfTestParser (void)
55925606
{
55935607
static const char *const extensions[] = { NULL };
@@ -5596,6 +5610,7 @@ static parserDefinition *CTagsSelfTestParser (void)
55965610
def->kindTable = CTST_Kinds;
55975611
def->kindCount = KIND_COUNT;
55985612
def->parser = createCTSTTags;
5613+
def->initialize = initCTST;
55995614
def->invisible = true;
56005615
def->useMemoryStreamInput = true;
56015616
def->useCork = CORK_QUEUE;

0 commit comments

Comments
 (0)