version 2.14.1
This commit is contained in:
@@ -3,8 +3,8 @@ cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
|||||||
project(pip)
|
project(pip)
|
||||||
set(pip_MAJOR 2)
|
set(pip_MAJOR 2)
|
||||||
set(pip_MINOR 14)
|
set(pip_MINOR 14)
|
||||||
set(pip_REVISION 0)
|
set(pip_REVISION 1)
|
||||||
set(pip_SUFFIX beta)
|
set(pip_SUFFIX )
|
||||||
set(pip_COMPANY SHS)
|
set(pip_COMPANY SHS)
|
||||||
set(pip_DOMAIN org.SHS)
|
set(pip_DOMAIN org.SHS)
|
||||||
|
|
||||||
|
|||||||
@@ -330,8 +330,10 @@ void PIEvaluator::makeOutput(PIString & string) {
|
|||||||
void PIEvaluator::findUnknownVariables() {
|
void PIEvaluator::findUnknownVariables() {
|
||||||
PIString cvar;
|
PIString cvar;
|
||||||
unknownVars.clear();
|
unknownVars.clear();
|
||||||
|
usedVars.clear();
|
||||||
for (int i = 0; i < currentString.length(); i++) {
|
for (int i = 0; i < currentString.length(); i++) {
|
||||||
if (elements[i].var_num == -666) cvar += currentString[i];
|
if (elements[i].var_num >= 0) usedVars << content.variable(elements[i].var_num).name;
|
||||||
|
else if (elements[i].var_num == -666) cvar += currentString[i];
|
||||||
else {
|
else {
|
||||||
if (cvar.length() == 0) continue;
|
if (cvar.length() == 0) continue;
|
||||||
unknownVars << cvar;
|
unknownVars << cvar;
|
||||||
@@ -340,6 +342,7 @@ void PIEvaluator::findUnknownVariables() {
|
|||||||
}
|
}
|
||||||
if (cvar.length() > 0) unknownVars << cvar;
|
if (cvar.length() > 0) unknownVars << cvar;
|
||||||
unknownVars.removeDuplicates();
|
unknownVars.removeDuplicates();
|
||||||
|
usedVars.removeDuplicates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1196,7 +1199,7 @@ complexd PIEvaluator::evaluate() {
|
|||||||
|
|
||||||
PIByteArray PIEvaluator::save() const {
|
PIByteArray PIEvaluator::save() const {
|
||||||
PIByteArray ret;
|
PIByteArray ret;
|
||||||
ret << content << currentVariables << unknownVars << instructions << currentString << lastError << out << correct;
|
ret << content << currentVariables << unknownVars << instructions << currentString << lastError << out << correct << usedVars;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1204,5 +1207,6 @@ PIByteArray PIEvaluator::save() const {
|
|||||||
void PIEvaluator::load(PIByteArray ba) {
|
void PIEvaluator::load(PIByteArray ba) {
|
||||||
if (ba.size() <= 4) return;
|
if (ba.size() <= 4) return;
|
||||||
ba >> content >> currentVariables >> unknownVars >> instructions >> currentString >> lastError >> out >> correct;
|
ba >> content >> currentVariables >> unknownVars >> instructions >> currentString >> lastError >> out >> correct;
|
||||||
|
if (ba.size() >= 4) ba >> usedVars;
|
||||||
variables = currentVariables;
|
variables = currentVariables;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ public:
|
|||||||
//! Returns all unknown variables founded in last expression passed to \a check() function
|
//! Returns all unknown variables founded in last expression passed to \a check() function
|
||||||
const PIStringList & unknownVariables() const {return unknownVars;}
|
const PIStringList & unknownVariables() const {return unknownVars;}
|
||||||
|
|
||||||
|
//! Returns all used variables founded in last expression passed to \a check() function
|
||||||
|
const PIStringList & usedVariables() const {return usedVars;}
|
||||||
|
|
||||||
//! Returns processed last expression passed to \a check() function
|
//! Returns processed last expression passed to \a check() function
|
||||||
const PIString & expression() const {return currentString;}
|
const PIString & expression() const {return currentString;}
|
||||||
|
|
||||||
@@ -220,7 +223,7 @@ private:
|
|||||||
PIDeque<PIEvaluatorTypes::Element> elements;
|
PIDeque<PIEvaluatorTypes::Element> elements;
|
||||||
PIVector<PIEvaluatorTypes::Variable> currentVariables, variables, tmpvars, * kvars;
|
PIVector<PIEvaluatorTypes::Variable> currentVariables, variables, tmpvars, * kvars;
|
||||||
PIVector<PIEvaluatorTypes::Instruction> instructions;
|
PIVector<PIEvaluatorTypes::Instruction> instructions;
|
||||||
PIStringList unknownVars;
|
PIStringList unknownVars, usedVars;
|
||||||
PIString currentString, lastError;
|
PIString currentString, lastError;
|
||||||
complexd out;
|
complexd out;
|
||||||
bool correct;
|
bool correct;
|
||||||
|
|||||||
Reference in New Issue
Block a user