// TODO: don't require pop
if (!expr) context.consumeCurrentValue();
}
public void compileOr(Node node, BodyCompiler context, boolean expr) {
final OrNode orNode = (OrNode) node;
if (orNode.getFirstNode().getNodeType().alwaysTrue()) {
// compile first node only
compile(orNode.getFirstNode(), context, expr);
} else if (orNode.getFirstNode().getNodeType().alwaysFalse()) {
// compile first node as non-expr and compile second node
compile(orNode.getFirstNode(), context, false);
compile(orNode.getSecondNode(), context, expr);
} else {
compile(orNode.getFirstNode(), context, true);
BranchCallback longCallback = new BranchCallback() {
public void branch(BodyCompiler context) {
compile(orNode.getSecondNode(), context, true);
}
};
context.performLogicalOr(longCallback);
// TODO: don't require pop