Comparison

tools/ejabberdsql2prosody.lua @ 1598:d82e13d57821

ejabberdsql2prosody: Added support for the escape sequence '\\' in strings
author Waqas Hussain <waqas20@gmail.com>
date Sun, 26 Jul 2009 17:29:56 +0500
parent 1597:84328a4df655
child 1599:308986a3e66a
comparison
equal deleted inserted replaced
1597:84328a4df655 1598:d82e13d57821
37 end 37 end
38 38
39 local function unescape(s) 39 local function unescape(s)
40 if s == "\\'" then return "'"; end 40 if s == "\\'" then return "'"; end
41 if s == "\\n" then return "\n"; end 41 if s == "\\n" then return "\n"; end
42 if s == "\\\\" then return "\\"; end
42 error("Unknown escape sequence: "..s); 43 error("Unknown escape sequence: "..s);
43 end 44 end
44 local function readString() 45 local function readString()
45 read("'"); 46 read("'");
46 local s = ""; 47 local s = "";