diff --git a/main/entry.c b/main/entry.c index b6374f3404..8b8cddaa7e 100644 --- a/main/entry.c +++ b/main/entry.c @@ -2173,6 +2173,28 @@ extern bool isTagExtra (const tagEntryInfo *const tag) return false; } +extern void copyTagExtraBit (const tagEntryInfo *const src, tagEntryInfo *const dst) +{ + unsigned int count = countXtags(); + for (unsigned int i = count; i > 0; i--) + { + if (isTagExtraBitMarked (src, i - 1)) + markTagExtraBit (dst, i - 1); + else + unmarkTagExtraBit (dst, i - 1); + } +} +extern void resetTagCorkState (tagEntryInfo *const tag) +{ + tag->inCorkQueue = 0; + if (tag->extraDynamic) + { + tagEntryInfo original = *tag; + tag->extraDynamic = NULL; + copyTagExtraBit (&original, tag); + } +} + static void assignRoleFull (tagEntryInfo *const e, int roleIndex, bool assign) { if (roleIndex == ROLE_DEFINITION_INDEX) diff --git a/main/entry.h b/main/entry.h index ac9e3ab68f..ef3cb825eb 100644 --- a/main/entry.h +++ b/main/entry.h @@ -259,10 +259,13 @@ extern bool removeFromIntervalTabMaybe(int corkIndex); extern void markTagExtraBit (tagEntryInfo *const tag, xtagType extra); extern void unmarkTagExtraBit (tagEntryInfo *const tag, xtagType extra); extern bool isTagExtraBitMarked (const tagEntryInfo *const tag, xtagType extra); +extern void copyTagExtraBit (const tagEntryInfo *const src, tagEntryInfo *const dst); /* If any extra bit is on, return true. */ extern bool isTagExtra (const tagEntryInfo *const tag); +extern void resetTagCorkState (tagEntryInfo *const tag); + /* Functions for attaching parser specific fields * * Which function should I use?