Mercurial Hosting > luan
view core/src/luan/impl/Block.java @ 535:289908469e02
parse numeric constants to ints or longs if possible
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 31 May 2015 00:00:17 -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); } } }