Mercurial Hosting > luan
diff src/luan/modules/StringLuan.java @ 1333:25746915a241
merge Luan and LuanState
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 12 Feb 2019 22:33:40 -0700 |
parents | 9fa8b8389578 |
children | c88b486a9511 |
line wrap: on
line diff
--- a/src/luan/modules/StringLuan.java Tue Feb 12 21:50:26 2019 -0700 +++ b/src/luan/modules/StringLuan.java Tue Feb 12 22:33:40 2019 -0700 @@ -4,7 +4,6 @@ import java.util.regex.Pattern; import java.util.regex.Matcher; import luan.Luan; -import luan.LuanState; import luan.LuanTable; import luan.LuanFunction; import luan.LuanException; @@ -131,7 +130,7 @@ Utils.checkNotNull(s); final Matcher m = Pattern.compile(pattern).matcher(s); return new LuanFunction() { - @Override public Object call(LuanState luan,Object[] args) { + @Override public Object call(Luan luan,Object[] args) { if( !m.find() ) return null; final int n = m.groupCount(); @@ -146,7 +145,7 @@ }; } - @LuanMethod public static Object[] gsub(LuanState luan,String s,String pattern,Object repl,Integer n) throws LuanException { + @LuanMethod 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); @@ -210,7 +209,7 @@ return String.format(format,args); } - public static String concat(LuanState luan,Object... args) throws LuanException { + public static String concat(Luan luan,Object... args) throws LuanException { StringBuilder sb = new StringBuilder(); for( Object arg : args ) { sb.append( luan.toString(arg) );