comparison src/luan/interp/ConcatExpr.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 b7d7069fee58
children e51906de0f11
comparison
equal deleted inserted replaced
30:8d8f4f5caef4 31:5cf15507d77e
1 package luan.interp; 1 package luan.interp;
2 2
3 import luan.Lua; 3 import luan.Lua;
4 import luan.LuaNumber; 4 import luan.LuaNumber;
5 import luan.LuaException; 5 import luan.LuaException;
6 import luan.LuaState;
7 6
8 7
9 final class ConcatExpr extends BinaryOpExpr { 8 final class ConcatExpr extends BinaryOpExpr {
10 9
11 ConcatExpr(Expr op1,Expr op2) { 10 ConcatExpr(Expr op1,Expr op2) {
12 super(op1,op2); 11 super(op1,op2);
13 } 12 }
14 13
15 @Override public Object eval(LuaState lua) throws LuaException { 14 @Override public Object eval(LuaStateImpl lua) throws LuaException {
16 return toString(op1.eval(lua)) + toString(op2.eval(lua)); 15 return toString(op1.eval(lua)) + toString(op2.eval(lua));
17 } 16 }
18 17
19 private static String toString(Object v) throws LuaException { 18 private static String toString(Object v) throws LuaException {
20 String s = Lua.asString(v); 19 String s = Lua.asString(v);