mod_presence: Construct a 'from' JID when roster items are removed outside of a session
[prosody.git] / tools / erlparse.lua
index dc3a2f94e6d44c3d03fa20d09dc57c94bec31d69..25c38bcf4d72d1756c18543af1ee9d41ac33c529 100644 (file)
@@ -1,7 +1,7 @@
 -- Prosody IM
 -- Copyright (C) 2008-2010 Matthew Wild
 -- Copyright (C) 2008-2010 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -51,7 +51,7 @@ local function isSpace(ch)
        return ch <= _space;
 end
 
-local escapes = {["\\b"]="\b", ["\\d"]="\d", ["\\e"]="\e", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]="\s", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"};
+local escapes = {["\\b"]="\b", ["\\d"]="\127", ["\\e"]="\27", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]=" ", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"};
 local function readString()
        read("\""); -- skip quote
        local slash = nil;
@@ -95,6 +95,12 @@ local function readNumber()
        while isNumeric(peek()) do
                num[#num+1] = read();
        end
+       if peek() == "." then
+               num[#num+1] = read();
+               while isNumeric(peek()) do
+                       num[#num+1] = read();
+               end
+       end
        return tonumber(t_concat(num));
 end
 local readItem = nil;