seed the Precedence next generation differently, so can pop as well as just push precedence stack as we unwind imports

This commit is contained in:
jez 2008-11-24 22:26:58 +00:00
parent 6f39b28daa
commit 538a8969ad
2 changed files with 5 additions and 1 deletions

View file

@ -146,6 +146,7 @@ public:
void pop_import_precedence()
{
precedenceStack_.pop();
} // pop_import_precedence
const Precedence& precedence() const

View file

@ -90,7 +90,7 @@ public:
} // PrecedenceStack
const Precedence& top() const { return stack_.top(); }
void push() { stack_.push(top().nextGeneration(stack_.size())); }
void push() { stack_.push(top().nextGeneration(count_++)); }
void pop() { stack_.pop(); }
void freeze()
{
@ -101,5 +101,8 @@ public:
private:
std::stack<Precedence> stack_;
static int count_;
}; // class PrecedenceStack
int PrecedenceStack::count_ = 0;
#endif