Mercurial Hosting > luan
diff core/src/luan/impl/ForStmt.java @ 645:859c0dedc8b6
remove LuanSource
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 29 Mar 2016 18:09:51 -0600 |
parents | d7a85fbe15f1 |
children | 8e8c30b72e9b |
line wrap: on
line diff
--- a/core/src/luan/impl/ForStmt.java Tue Mar 29 13:53:01 2016 -0600 +++ b/core/src/luan/impl/ForStmt.java Tue Mar 29 18:09:51 2016 -0600 @@ -3,7 +3,6 @@ import luan.Luan; import luan.LuanException; import luan.LuanFunction; -import luan.LuanElement; final class ForStmt extends CodeImpl implements Stmt { @@ -12,8 +11,7 @@ private final Expr iterExpr; private final Stmt block; - ForStmt(LuanElement el,int iVars,int nVars,Expr iterExpr,Stmt block) { - super(el); + ForStmt(int iVars,int nVars,Expr iterExpr,Stmt block) { this.iVars = iVars; this.nVars = nVars; this.iterExpr = iterExpr; @@ -22,10 +20,8 @@ @Override public void eval(LuanStateImpl luan) throws LuanException { Object fnObj = iterExpr.eval(luan); - luan.push( iterExpr.el(), iterExpr.el().text() ); try { LuanFunction iter = luan.checkFunction(fnObj); - String name = iterExpr.el().text(); while(true) { Object vals = iter.call(luan); if( vals==null ) @@ -48,7 +44,6 @@ } catch(BreakException e) { } finally { luan.stackClear(iVars,iVars+nVars); - luan.pop(); } }