Mercurial Hosting > luan
comparison core/src/luan/impl/SetTableEntry.java @ 428:df95199ca4c0
rename __newindex to __new_index
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2015 20:10:31 -0600 |
parents | dae264ad6a7b |
children | b48cfa14ba60 |
comparison
equal
deleted
inserted
replaced
427:dae264ad6a7b | 428:df95199ca4c0 |
---|---|
18 this.tableExpr = tableExpr; | 18 this.tableExpr = tableExpr; |
19 this.keyExpr = keyExpr; | 19 this.keyExpr = keyExpr; |
20 } | 20 } |
21 | 21 |
22 @Override public void set(LuanStateImpl luan,Object value) throws LuanException { | 22 @Override public void set(LuanStateImpl luan,Object value) throws LuanException { |
23 newindex( luan, tableExpr.eval(luan), keyExpr.eval(luan), value ); | 23 newIndex( luan, tableExpr.eval(luan), keyExpr.eval(luan), value ); |
24 } | 24 } |
25 | 25 |
26 private void newindex(LuanStateImpl luan,Object t,Object key,Object value) throws LuanException { | 26 private void newIndex(LuanStateImpl luan,Object t,Object key,Object value) throws LuanException { |
27 if( t instanceof LuanTable ) { | 27 if( t instanceof LuanTable ) { |
28 LuanTable tbl = (LuanTable)t; | 28 LuanTable tbl = (LuanTable)t; |
29 tbl.put(luan,key,value); | 29 tbl.put(luan,key,value); |
30 return; | 30 return; |
31 } | 31 } |
32 if( t != null && luan.currentEnvironment().hasJava() ) | 32 if( t != null && luan.currentEnvironment().hasJava() ) |
33 JavaLuan.__newindex(luan,t,key,value); | 33 JavaLuan.__new_index(luan,t,key,value); |
34 else | 34 else |
35 throw luan.bit(se).exception( "attempt to index '"+tableExpr.se().text()+"' (a " + Luan.type(t) + " value)" ); | 35 throw luan.bit(se).exception( "attempt to index '"+tableExpr.se().text()+"' (a " + Luan.type(t) + " value)" ); |
36 } | 36 } |
37 | 37 |
38 } | 38 } |