Skip to content

Commit

Permalink
Correct map propagation when no right expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Jun 3, 2016
1 parent 11c5235 commit f2b70f9
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,15 +621,14 @@ public Object visit(ASTChirality node, Object data) {
}

public Object visit(ASTLowAndExpression node, Object data) {
Object left = node.jjtGetChild(0).jjtAccept(this, data);
if (node.jjtGetNumChildren() == 1) {
return left;
IAtom expr = (IAtom) node.jjtGetChild(0).jjtAccept(this, data);
if (node.jjtGetNumChildren() > 1) {
IQueryAtom right = (IQueryAtom) node.jjtGetChild(1).jjtAccept(this, data);
expr = LogicalOperatorAtom.and((IQueryAtom) expr, right);
}
IQueryAtom right = (IQueryAtom) node.jjtGetChild(1).jjtAccept(this, data);
IAtom res = LogicalOperatorAtom.and((IQueryAtom) left, right);
if (node.getMapIdx()>0)
res.setProperty(CDKConstants.ATOM_ATOM_MAPPING, node.getMapIdx());
return res;
expr.setProperty(CDKConstants.ATOM_ATOM_MAPPING, node.getMapIdx());
return expr;
}

public Object visit(ASTOrExpression node, Object data) {
Expand Down

0 comments on commit f2b70f9

Please sign in to comment.