re-initialize some variables for each file

merge 3570e978058816745101a69b552ad9d07e349542 and
00f2031c60bc472544b509586ee31c643ab2e81d from qt.
This commit is contained in:
Oswald Buddenhagen
2009-04-02 19:38:19 +02:00
parent 8bdfdba034
commit 4bece54f34

View File

@@ -224,15 +224,15 @@ public:
ProFileEvaluator::Private::Private(ProFileEvaluator *q_) ProFileEvaluator::Private::Private(ProFileEvaluator *q_)
: q(q_) : q(q_)
{ {
// Global parser state
m_prevLineNo = 0; m_prevLineNo = 0;
m_prevProFile = 0; m_prevProFile = 0;
// Configuration, more or less
m_verbose = true; m_verbose = true;
m_block = 0;
m_commentItem = 0;
m_syntaxError = 0;
m_lineNo = 0;
m_contNextLine = false;
m_cumulative = true; m_cumulative = true;
// Evaluator state
m_updateCondition = false; m_updateCondition = false;
m_condition = ConditionFalse; m_condition = ConditionFalse;
m_invertNext = false; m_invertNext = false;
@@ -248,8 +248,13 @@ bool ProFileEvaluator::Private::read(ProFile *pro)
return false; return false;
} }
// Parser state
m_block = 0;
m_commentItem = 0;
m_contNextLine = false;
m_syntaxError = false; m_syntaxError = false;
m_lineNo = 1; m_lineNo = 1;
m_blockstack.clear();
m_blockstack.push(pro); m_blockstack.push(pro);
QTextStream ts(&file); QTextStream ts(&file);