view core/src/luan/impl/OrExpr.java @ 372:f08cefa4594c

start editing manual
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 17 Apr 2015 07:58:20 -0600
parents 3dcb0f9bee82
children bf5e62a9090c
line wrap: on
line source

package luan.impl;

import luan.Luan;
import luan.LuanException;
import luan.LuanSource;


final class OrExpr extends BinaryOpExpr {

	OrExpr(LuanSource.Element se,Expr op1,Expr op2) {
		super(se,op1,op2);
	}

	@Override public Object eval(LuanStateImpl luan) throws LuanException {
		Object v1 = op1.eval(luan);
		return Luan.toBoolean(v1) ? v1 : op2.eval(luan);
	}
}