view core/src/luan/impl/NotExpr.java @ 586:a140be489a72

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 24 Aug 2015 02:17:46 -0600
parents 4723d22062ce
children 859c0dedc8b6
line wrap: on
line source

package luan.impl;

import luan.Luan;
import luan.LuanException;
import luan.LuanElement;


final class NotExpr extends UnaryOpExpr {

	NotExpr(LuanElement el,Expr op) {
		super(el,op);
	}

	@Override public Object eval(LuanStateImpl luan) throws LuanException {
		return !luan.checkBoolean( op.eval(luan), op.el() );
	}

	@Override public String toString() {
		return "(NotExpr "+op+")";
	}
}