mirror of
https://github.com/jezhiggins/arabica
synced 2024-11-17 07:48:50 +01:00
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:
parent
6f39b28daa
commit
538a8969ad
2 changed files with 5 additions and 1 deletions
|
@ -146,6 +146,7 @@ public:
|
|||
|
||||
void pop_import_precedence()
|
||||
{
|
||||
precedenceStack_.pop();
|
||||
} // pop_import_precedence
|
||||
|
||||
const Precedence& precedence() const
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue