Fix code to compile in the expression parser
This commit is contained in:
@@ -494,7 +494,7 @@ namespace FrameLib_ExprParser
|
||||
return Node(kIsOutput, static_cast<long>(graph.mOperations.size() - 1));
|
||||
}
|
||||
|
||||
ExprParseError parseUnaryOperator(Graph<T>& graph, const OpBase<T> *op, NodeList& nodes, NodeListIterator& it)
|
||||
ExprParseError parseUnaryOperator(Graph<T>& graph, const OpBase<T> *op, NodeList& nodes, const NodeListIterator& it)
|
||||
{
|
||||
// Check the operator isn't last, that its either first, or precededed by an operator and not followed by one
|
||||
// N.B. return no error in case this is also an operator later, otherwise it'll be picked up as a stray item
|
||||
@@ -547,9 +547,9 @@ namespace FrameLib_ExprParser
|
||||
|
||||
// Now resolve unary operators by searching right-to-left
|
||||
|
||||
for (auto it = nodes.rbegin(); it != nodes.rend(); it++)
|
||||
if ((op = getOperator(it->getTokenString(), 0)))
|
||||
if ((error = parseUnaryOperator(graph, op, nodes, it)))
|
||||
for (auto it = nodes.end(); it != nodes.begin(); it--)
|
||||
if ((op = getOperator((it - 1)->getTokenString(), 0)))
|
||||
if ((error = parseUnaryOperator(graph, op, nodes, it - 1)))
|
||||
return error;
|
||||
|
||||
// Now resolve binary operators in order of precedence
|
||||
@@ -593,7 +593,7 @@ namespace FrameLib_ExprParser
|
||||
|
||||
// N.B. n1 is offset to stay in range
|
||||
|
||||
for (n1 = n2; n1 > nodes.begin(); n1--)
|
||||
for (n1 = n2; n1 != nodes.begin(); n1--)
|
||||
if ((n1 - 1)->isLHSParenthesis())
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user