摘要:JsonDecoder={ pos:0, isDigit:function(ch){ return ( ch >= '0' && ch = 'A' && ch = 'a' && ch <= 'f' ) ); }, toTrue:function(str, from,to) { JsonDeco...
阅读全文
摘要:lua对象json序列化,很简单,没做中文的unicode编码了local function bool2json(v) return v and "true" or "false";endlocal function string2json(s) return table.concat({"\"", s, "\""});endlocal allowedkey={ ["boolean"]=true, ["number"]=true, ["table
阅读全文
摘要:as2写的json解析,带容错,如果要做格式检查,得自己修改了,直接贴代码//--------------------------------------------------json解析----------------------------------------------------------class Json extends Object{ public static var pos:Number=0; private static function isDigit( ch:String ):Boolean { return ( ch >= '0' &am
阅读全文
摘要:自己写的lua解析json,带容错,如果要是用于格式检查,得修改下。很简单直接贴代码--------------------------------------------------json解析----------------------------------------------------------local function json2true(str,from,to) return true, from+3endlocal function json2false(str,from,to) return false, from+4endlocal function json2nu
阅读全文