Mercurial Hosting > luan
view core/src/luan/impl/IndexExpr.java @ 509:e3b0846dc2ef
throw exception for invalid indexes of string, binary, or java
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 22 May 2015 02:02:49 -0600 |
parents | d3183a330ff5 |
children | 2da0bcb979b5 |
line wrap: on
line source
package luan.impl; import luan.LuanException; import luan.LuanTable; 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 { return LuanTable.index( luan.bit(op1.el()), op1.eval(luan), op2.eval(luan) ); } }