Mercurial Hosting > luan
comparison src/luan/interp/AddExpr.java @ 11:b7d7069fee58
add assignment statement and CmdLine
git-svn-id: https://luan-java.googlecode.com/svn/trunk@12 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 22 Nov 2012 10:51:56 +0000 |
parents | 7a2cdbc5767f |
children | 5cf15507d77e |
comparison
equal
deleted
inserted
replaced
10:8217d8485715 | 11:b7d7069fee58 |
---|---|
10 | 10 |
11 AddExpr(Expr op1,Expr op2) { | 11 AddExpr(Expr op1,Expr op2) { |
12 super(op1,op2); | 12 super(op1,op2); |
13 } | 13 } |
14 | 14 |
15 @Override Object eval(LuaState lua) throws LuaException { | 15 @Override public Object eval(LuaState lua) throws LuaException { |
16 double n1 = Lua.checkNumber(op1.eval(lua)).value(); | 16 double n1 = Lua.checkNumber(op1.eval(lua)).value(); |
17 double n2 = Lua.checkNumber(op2.eval(lua)).value(); | 17 double n2 = Lua.checkNumber(op2.eval(lua)).value(); |
18 return new LuaNumber( n1 + n2 ); | 18 return new LuaNumber( n1 + n2 ); |
19 } | 19 } |
20 } | 20 } |