Mercurial Hosting > luan
view core/src/luan/impl/Block.java @ 609:24b05963ba62
shell "clear" button now clears the session
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 09 Dec 2015 18:12:16 -0700 |
parents | 3dcb0f9bee82 |
children |
line wrap: on
line source
package luan.impl; import luan.LuanException; final class Block implements Stmt { final Stmt[] stmts; private final int stackStart; private final int stackEnd; Block(Stmt[] stmts,int stackStart,int stackEnd) { if( stmts.length==0 ) throw new RuntimeException("empty block"); this.stmts = stmts; this.stackStart = stackStart; this.stackEnd = stackEnd; } @Override public void eval(LuanStateImpl luan) throws LuanException { try { for( Stmt stmt : stmts ) { stmt.eval(luan); } } finally { luan.stackClear(stackStart,stackEnd); } } }