Skip to content

Commit 6f0c51d

Browse files
committed
main: make automatic FQ tag emission based on the language associated with the target tag
A language can specify whether the main part does automagic-FQ-tag emission or not with requestAutomaticFQTag field of parserDefinition. To access the requestAutomaticFQTag field, the original code calls getInputLanguage(). However, this didn't work expectedly. When a subparser made a tag, it was stored to the corkQueue. The corkQueue was flushed after the subparser run, within the base parser run. As the result requestAutomaticFQTag field of the base parser was referred when calling getInputLanguage(). This changes refers the tag itself to access the requestAutomaticFQTag field instead of calling getInputLanguage(). Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 4789b8c commit 6f0c51d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

main/entry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static void writeTagEntry (const tagEntryInfo *const tag)
15461546

15471547
if (includeExtensionFlags ()
15481548
&& isXtagEnabled (XTAG_QUALIFIED_TAGS)
1549-
&& doesInputLanguageRequestAutomaticFQTag ()
1549+
&& doesInputLanguageRequestAutomaticFQTag (tag)
15501550
&& !isTagExtraBitMarked (tag, XTAG_QUALIFIED_TAGS)
15511551
&& !tag->skipAutoFQEmission)
15521552
{
@@ -1616,7 +1616,7 @@ extern void uncorkTagFile(void)
16161616

16171617
writeTagEntry (tag);
16181618

1619-
if (doesInputLanguageRequestAutomaticFQTag ()
1619+
if (doesInputLanguageRequestAutomaticFQTag (tag)
16201620
&& isXtagEnabled (XTAG_QUALIFIED_TAGS)
16211621
&& !isTagExtraBitMarked (tag, XTAG_QUALIFIED_TAGS)
16221622
&& !tag->skipAutoFQEmission

main/read.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ extern bool doesInputLanguageAllowNullTag (void)
245245
return doesLanguageAllowNullTag (getInputLanguage ());
246246
}
247247

248-
extern bool doesInputLanguageRequestAutomaticFQTag (void)
248+
extern bool doesInputLanguageRequestAutomaticFQTag (const tagEntryInfo *e)
249249
{
250-
return doesLanguageRequestAutomaticFQTag (getInputLanguage ());
250+
return doesLanguageRequestAutomaticFQTag (e->langType);
251251
}
252252

253253
extern const char *getSourceFileTagPath (void)

main/read_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern unsigned int countInputLanguageKinds (void);
4040
extern unsigned int countInputLanguageRoles (int kindIndex);
4141

4242
extern bool doesInputLanguageAllowNullTag (void);
43-
extern bool doesInputLanguageRequestAutomaticFQTag (void);
43+
extern bool doesInputLanguageRequestAutomaticFQTag (const tagEntryInfo *e);
4444
extern bool doesParserRunAsGuest (void);
4545
extern bool doesSubparserRun (void);
4646
extern langType getLanguageForBaseParser (void);

0 commit comments

Comments
 (0)