Commit ff0af050 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed CNF expressions transformations with explicit braces

parent e4ea524f
......@@ -3310,6 +3310,7 @@ AST::Expression * SyntaxAnalizerPrivate::parseExpression(
if (oper) {
subexpression << oper;
}
operand->expressionIsClosed = true;
} // end if (blockType==SubExpression)
else if (blockType==None) {
if (oper) {
......@@ -4601,6 +4602,9 @@ AST::Expression * SyntaxAnalizerPrivate::makeExpressionTree(const QList<Subexpre
(tailIsLiteral && literalOperands)
);
if (headExpr->expressionIsClosed)
makeCNF = false;
if (makeCNF) {
AST::Expression * res = new AST::Expression;
res->kind = AST::ExprSubexpression;
......
......@@ -11,6 +11,7 @@ Expression::Expression()
baseType.kind = TypeNone;
variable = NULL;
function = NULL;
expressionIsClosed = false;
constant = QVariant::Invalid;
operatorr = AST::OpNone;
dimension = 0;
......
......@@ -92,6 +92,10 @@ struct ABSTRACTSYNTAXTREE_EXPORT Expression {
*/
QList<struct Expression *> operands;
/** True if expression () bounds.
* This flag is used to avoid CNF-transofmations */
bool expressionIsClosed;
/** Operator in case of kind==StSubexpression, emty otherwise */
enum ExpressionOperator operatorr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment