summaryrefslogtreecommitdiff
path: root/starmath/source/parse.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/parse.cxx')
-rw-r--r--starmath/source/parse.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index cc35a6698775..cdb6865db623 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1108,10 +1108,18 @@ void SmParser::Expression()
RelationArray[n - 1] = lcl_popOrZero(m_aNodeStack);
}
- SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken);
- pSNode->SetSubNodes(RelationArray);
- pSNode->SetUseExtraSpaces(bUseExtraSpaces);
- m_aNodeStack.push(pSNode);
+ if (n > 1)
+ {
+ SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken);
+ pSNode->SetSubNodes(RelationArray);
+ pSNode->SetUseExtraSpaces(bUseExtraSpaces);
+ m_aNodeStack.push(pSNode);
+ }
+ else
+ {
+ // This expression has only one node so just push this node.
+ m_aNodeStack.push(RelationArray[0]);
+ }
}