Mercurial Hosting > luan
diff core/src/luan/impl/FnDef.java @ 663:b438a47196bc
finish compiling function blocks
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 07 Apr 2016 00:01:10 -0600 |
parents | 859c0dedc8b6 |
children | 71f8f5075df8 |
line wrap: on
line diff
--- a/core/src/luan/impl/FnDef.java Wed Apr 06 21:47:45 2016 -0600 +++ b/core/src/luan/impl/FnDef.java Thu Apr 07 00:01:10 2016 -0600 @@ -4,21 +4,21 @@ final class FnDef extends CodeImpl implements Expr { - final Stmt block; + final Expressions block; final int stackSize; final int numArgs; final boolean isVarArg; final UpValue.Getter[] upValueGetters; - FnDef(Stmt block,int stackSize,int numArgs,boolean isVarArg,UpValue.Getter[] upValueGetters) { + FnDef(Expressions block,int stackSize,int numArgs,boolean isVarArg,UpValue.Getter[] upValueGetters) { this.block = block; this.stackSize = stackSize; this.numArgs = numArgs; this.isVarArg = isVarArg; this.upValueGetters = upValueGetters; - fixReturns(block); +// fixReturns(block); } - +/* private static void fixReturns(Stmt stmt) { if( stmt instanceof ReturnStmt ) { ReturnStmt rs = (ReturnStmt)stmt; @@ -32,7 +32,7 @@ fixReturns( is.elseStmt ); } } - +*/ @Override public Object eval(LuanStateImpl luan) throws LuanException { return new Closure(luan,this); }