void MacroExpander::popMacro() { assert(!mContextStack.empty()); MacroContext *context = mContextStack.back(); mContextStack.pop_back(); assert(context->empty()); assert(context->macro->disabled); context->macro->disabled = false; delete context; }
void MacroExpander::ungetToken(const Token &token) { if (!mContextStack.empty()) { MacroContext *context = mContextStack.back(); context->unget(); assert(context->replacements[context->index] == token); } else { assert(!mReserveToken.get()); mReserveToken.reset(new Token(token)); } }
void MacroExpander::popMacro() { ASSERT(!mContextStack.empty()); MacroContext *context = mContextStack.back(); mContextStack.pop_back(); ASSERT(context->empty()); ASSERT(context->macro->disabled); ASSERT(context->macro->expansionCount > 0); context->macro->disabled = false; context->macro->expansionCount--; mTotalTokensInContexts -= context->replacements.size(); delete context; }
void MacroExpander::popMacro() { ASSERT(!mContextStack.empty()); MacroContext *context = mContextStack.back(); mContextStack.pop_back(); ASSERT(context->empty()); ASSERT(context->macro->disabled); ASSERT(context->macro->expansionCount > 0); if (mDeferReenablingMacros) { mMacrosToReenable.push_back(context->macro); } else { context->macro->disabled = false; } context->macro->expansionCount--; mTotalTokensInContexts -= context->replacements.size(); delete context; }