Mercurial Hosting > luan
changeset 548:f4dfe9c64c25
shorten some String function names
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 15 Jun 2015 17:30:28 -0600 |
parents | 0be287ab0309 |
children | c69b4833a3a3 |
files | core/src/luan/modules/String.luan core/src/luan/modules/StringLuan.java lucene/src/luan/modules/lucene/Versioning.luan lucene/src/luan/modules/lucene/Web_search.luan scripts/test.luan |
diffstat | 5 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
diff -r 0be287ab0309 -r f4dfe9c64c25 core/src/luan/modules/String.luan --- a/core/src/luan/modules/String.luan Mon Jun 15 01:22:58 2015 -0600 +++ b/core/src/luan/modules/String.luan Mon Jun 15 17:30:28 2015 -0600 @@ -19,9 +19,9 @@ M.matches = StringLuan.matches M.rep = StringLuan.rep M.reverse = StringLuan.reverse -M.string_to_binary = StringLuan.string_to_binary -M.string_to_number = StringLuan.string_to_number M.sub = StringLuan.sub +M.to_binary = StringLuan.to_binary +M.to_number = StringLuan.to_number M.trim = StringLuan.trim M.upper = StringLuan.upper
diff -r 0be287ab0309 -r f4dfe9c64c25 core/src/luan/modules/StringLuan.java --- a/core/src/luan/modules/StringLuan.java Mon Jun 15 01:22:58 2015 -0600 +++ b/core/src/luan/modules/StringLuan.java Mon Jun 15 17:30:28 2015 -0600 @@ -52,7 +52,7 @@ return new String(a); } - @LuanMethod public static byte[] string_to_binary(String s) { + @LuanMethod public static byte[] to_binary(String s) { return s.getBytes(); } @@ -223,7 +223,7 @@ return Luan.stringEncode(s); } - public static Number string_to_number(LuanState luan,String s,Integer base) throws LuanException { + public static Number to_number(LuanState luan,String s,Integer base) throws LuanException { Utils.checkNotNull(luan,s); try { if( base == null ) {
diff -r 0be287ab0309 -r f4dfe9c64c25 lucene/src/luan/modules/lucene/Versioning.luan --- a/lucene/src/luan/modules/lucene/Versioning.luan Mon Jun 15 01:22:58 2015 -0600 +++ b/lucene/src/luan/modules/lucene/Versioning.luan Mon Jun 15 17:30:28 2015 -0600 @@ -7,7 +7,7 @@ local String = require "luan:String" local matches = String.matches or error() local sub = String.sub or error() -local string_to_number = String.string_to_number or error() +local string_to_number = String.to_number or error() local Table = require "luan:Table" local clone = Table.clone or error() local Lucene = require "luan:lucene/Lucene"
diff -r 0be287ab0309 -r f4dfe9c64c25 lucene/src/luan/modules/lucene/Web_search.luan --- a/lucene/src/luan/modules/lucene/Web_search.luan Mon Jun 15 01:22:58 2015 -0600 +++ b/lucene/src/luan/modules/lucene/Web_search.luan Mon Jun 15 17:30:28 2015 -0600 @@ -1,13 +1,13 @@ local Luan = require "luan:Luan" -local load = Luan.load -local pairs = Luan.pairs -local ipairs = Luan.ipairs -local range = Luan.range -local to_string = Luan.to_string +local error = Luan.error +local pairs = Luan.pairs or error() +local ipairs = Luan.ipairs or error() +local range = Luan.range or error() +local to_string = Luan.to_string or error() local Io = require "luan:Io" local Http = require "luan:http/Http" local String = require "luan:String" -local string_to_number = String.string_to_number +local string_to_number = String.to_number or error() local Html = require "luan:Html" local M = {}
diff -r 0be287ab0309 -r f4dfe9c64c25 scripts/test.luan --- a/scripts/test.luan Mon Jun 15 01:22:58 2015 -0600 +++ b/scripts/test.luan Mon Jun 15 17:30:28 2015 -0600 @@ -14,6 +14,7 @@ local Http_test = require "luan:http/Http_test" local Server = require "luan:http/Server" local Lucene = require "luan:lucene/Lucene" +local Versioning = require "luan:lucene/Versioning" local Mail = require "luan:mail/Mail" local Stripe = require "luan:stripe/Stripe"