Mercurial Hosting > luan
comparison core/src/luan/impl/LuanImpl.java @ 655:e2be71451d04
compile TableExpr
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 05 Apr 2016 15:28:07 -0600 |
parents | ea7dbd2dfa65 |
children | e064377994b2 |
comparison
equal
deleted
inserted
replaced
654:ea7dbd2dfa65 | 655:e2be71451d04 |
---|---|
240 return rtn; | 240 return rtn; |
241 } | 241 } |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 public static LuanTable table(Object o) { | |
246 LuanTable table = new LuanTable(); | |
247 int i = 0; | |
248 for( Object fld : Luan.array(o) ) { | |
249 if( fld instanceof TableField ) { | |
250 TableField tblFld = (TableField)fld; | |
251 Object key = tblFld.key; | |
252 Object value = tblFld.value; | |
253 if( key != null && value != null ) | |
254 table.rawPut(key,value); | |
255 } else { | |
256 i++; | |
257 if( fld != null ) | |
258 table.rawPut(i,fld); | |
259 } | |
260 } | |
261 return table; | |
262 } | |
263 | |
245 } | 264 } |