Mercurial Hosting > luan
view core/src/luan/impl/Block.java @ 498:ee55be414a34
Http.response is now mostly luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 18 May 2015 00:25:35 -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); } } }