mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 09:19:41 +00:00
fixed round brackets parsing bug
This commit is contained in:
parent
ed92ffcf89
commit
73f9436ed9
2 changed files with 17 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
||||
#include "generator.hpp"
|
||||
#include "scanner.hpp"
|
||||
|
@ -51,6 +52,11 @@ namespace Compiler
|
|||
return mOperators[mOperators.size()-1];
|
||||
}
|
||||
|
||||
bool ExprParser::isOpen() const
|
||||
{
|
||||
return std::find (mOperators.begin(), mOperators.end(), '(')!=mOperators.end();
|
||||
}
|
||||
|
||||
void ExprParser::popOperator()
|
||||
{
|
||||
assert (!mOperators.empty());
|
||||
|
@ -293,8 +299,15 @@ namespace Compiler
|
|||
|
||||
if (code==Scanner::S_close && !mNextOperand)
|
||||
{
|
||||
close();
|
||||
return true;
|
||||
if (isOpen())
|
||||
{
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
mTokenLoc = loc;
|
||||
scanner.putbackSpecial (code, loc);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mNextOperand)
|
||||
|
|
|
@ -30,6 +30,8 @@ namespace Compiler
|
|||
|
||||
char getOperator() const;
|
||||
|
||||
bool isOpen() const;
|
||||
|
||||
void popOperator();
|
||||
|
||||
void popOperand();
|
||||
|
|
Loading…
Reference in a new issue