Mercurial Hosting > luan
view core/src/luan/impl/IndexExpr.java @ 581:5d4652d78ce0
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 30 Jul 2015 20:56:53 -0600 |
parents | 4723d22062ce |
children | 859c0dedc8b6 |
line wrap: on
line source
package luan.impl; import luan.LuanException; import luan.LuanElement; final class IndexExpr extends BinaryOpExpr { IndexExpr(LuanElement el,Expr op1,Expr op2) { super(el,op1,op2); } @Override public Object eval(LuanStateImpl luan) throws LuanException { Object o1 = op1.eval(luan); Object o2 = op2.eval(luan); luan.push(el,null); try { return luan.index(o1,o2); } finally { luan.pop(); } } }