Mercurial Hosting > luan
view core/src/luan/impl/Block.java @ 584:0742ac78fa69
add Luan.load_theme
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 12 Aug 2015 05:21:21 -0600 |
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); } } }