Mercurial Hosting > luan
comparison src/luan/interp/Chunk.java @ 31:5cf15507d77e
separate interpreter from interface
git-svn-id: https://luan-java.googlecode.com/svn/trunk@32 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 13 Dec 2012 02:50:04 +0000 |
parents | 7ee247560db5 |
children | c3eab5a3ce3c |
comparison
equal
deleted
inserted
replaced
30:8d8f4f5caef4 | 31:5cf15507d77e |
---|---|
1 package luan.interp; | 1 package luan.interp; |
2 | 2 |
3 import luan.LuaState; | |
4 import luan.LuaException; | 3 import luan.LuaException; |
5 import luan.LuaClosure; | |
6 | 4 |
7 | 5 |
8 public final class Chunk implements Expr { | 6 final class Chunk implements Expr { |
9 public final Stmt block; | 7 public final Stmt block; |
10 public final int stackSize; | 8 public final int stackSize; |
11 public final int numArgs; | 9 public final int numArgs; |
12 public final boolean isVarArg; | 10 public final boolean isVarArg; |
13 | 11 |
31 fixReturns( is.thenStmt ); | 29 fixReturns( is.thenStmt ); |
32 fixReturns( is.elseStmt ); | 30 fixReturns( is.elseStmt ); |
33 } | 31 } |
34 } | 32 } |
35 | 33 |
36 public LuaClosure newClosure(LuaState lua) { | 34 LuaClosure newClosure(LuaStateImpl lua) { |
37 return new LuaClosure(this,lua); | 35 return new LuaClosure(this,lua); |
38 } | 36 } |
39 | 37 |
40 @Override public Object eval(LuaState lua) { | 38 @Override public Object eval(LuaStateImpl lua) { |
41 return newClosure(lua); | 39 return newClosure(lua); |
42 } | 40 } |
43 | 41 |
44 } | 42 } |