Mercurial Hosting > luan
diff core/src/luan/modules/StringLuan.java @ 426:23a93c118042
fix LuanTable.get() to use metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 May 2015 18:44:20 -0600 |
parents | e9d4d5854e54 |
children | 93e6e67768d7 |
line wrap: on
line diff
--- a/core/src/luan/modules/StringLuan.java Fri May 01 17:18:23 2015 -0600 +++ b/core/src/luan/modules/StringLuan.java Fri May 01 18:44:20 2015 -0600 @@ -16,7 +16,7 @@ public static Object __index(LuanState luan,final String s,Object key) throws LuanException { LuanTable mod = (LuanTable)PackageLuan.require(luan,"luan:String"); - Object obj = mod.get(key); + Object obj = mod.get(luan,key); if( obj instanceof LuanFunction ) { final LuanFunction fn = (LuanFunction)obj; return new LuanFunction() { @@ -180,7 +180,7 @@ StringBuffer sb = new StringBuffer(); while( i<max && m.find() ) { String match = m.groupCount()==0 ? m.group() : m.group(1); - Object val = t.get(match); + Object val = t.get(luan,match); if( Luan.toBoolean(val) ) { String replacement = Luan.asString(val); if( replacement==null )