Mercurial Hosting > luan
diff src/luan/modules/StringLuan.java @ 1562:b89212fd04b5
remove table.luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 08 Nov 2020 16:50:59 -0700 |
parents | 1b397a949791 |
children | 8fbcc4747091 |
line wrap: on
line diff
--- a/src/luan/modules/StringLuan.java Thu Nov 05 20:24:09 2020 -0700 +++ b/src/luan/modules/StringLuan.java Sun Nov 08 16:50:59 2020 -0700 @@ -145,7 +145,7 @@ }; } - public static Object[] gsub(String s,String pattern,Object repl,Integer n) throws LuanException { + public static Object[] gsub(Luan luan,String s,String pattern,Object repl,Integer n) throws LuanException { Utils.checkNotNull(s); int max = n==null ? Integer.MAX_VALUE : n; final Matcher m = Pattern.compile(pattern).matcher(s); @@ -166,7 +166,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( val != null ) { String replacement = Luan.luanToString(val); m.appendReplacement(sb,replacement);