Mercurial Hosting > luan
comparison src/luan/interp/LenExpr.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 | bca8fc5d928b |
children | 5cf15507d77e |
comparison
equal
deleted
inserted
replaced
10:8217d8485715 | 11:b7d7069fee58 |
---|---|
11 | 11 |
12 LenExpr(Expr op) { | 12 LenExpr(Expr op) { |
13 super(op); | 13 super(op); |
14 } | 14 } |
15 | 15 |
16 @Override Object eval(LuaState lua) throws LuaException { | 16 @Override public Object eval(LuaState lua) throws LuaException { |
17 return new LuaNumber( length(op.eval(lua)) ); | 17 return new LuaNumber( length(op.eval(lua)) ); |
18 } | 18 } |
19 | 19 |
20 private static int length(Object obj) throws LuaException { | 20 private static int length(Object obj) throws LuaException { |
21 if( obj instanceof String ) { | 21 if( obj instanceof String ) { |