Mercurial Hosting > luan
comparison src/luan/interp/LuaCompiler.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 | 8d8f4f5caef4 |
children | e3624b7cd603 |
comparison
equal
deleted
inserted
replaced
30:8d8f4f5caef4 | 31:5cf15507d77e |
---|---|
22 Object resultValue = result.resultValue; | 22 Object resultValue = result.resultValue; |
23 if( resultValue instanceof Expressions ) { | 23 if( resultValue instanceof Expressions ) { |
24 final Expressions expressions = (Expressions)resultValue; | 24 final Expressions expressions = (Expressions)resultValue; |
25 return new LuaFunction() { | 25 return new LuaFunction() { |
26 public Object[] call(LuaState lua,Object... args) throws LuaException { | 26 public Object[] call(LuaState lua,Object... args) throws LuaException { |
27 return expressions.eval(lua); | 27 return expressions.eval((LuaStateImpl)lua); |
28 } | 28 } |
29 }; | 29 }; |
30 } | 30 } |
31 Chunk chunk = (Chunk)resultValue; | 31 Chunk chunk = (Chunk)resultValue; |
32 return chunk.newClosure(lua); | 32 return chunk.newClosure((LuaStateImpl)lua); |
33 } | |
34 | |
35 public static LuaState newLuaState() { | |
36 return new LuaStateImpl(); | |
33 } | 37 } |
34 } | 38 } |