aboutsummaryrefslogtreecommitdiffstats
path: root/tools/erlparse.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-08-05 17:21:19 +0100
committerMatthew Wild <mwild1@gmail.com>2012-08-05 17:21:19 +0100
commitf6edccc24c0ebf7b4ec86826d66259ba1cad8f0d (patch)
treee484cf5d1806a0a3932418e65e4e4e39a1413e2a /tools/erlparse.lua
parente1cf1cf3880e871b4d28c6dc18d97eefa0122f32 (diff)
parenta5b04b23ec4dbbe5674b0ab596427193877923d6 (diff)
downloadprosody-f6edccc24c0ebf7b4ec86826d66259ba1cad8f0d.tar.gz
prosody-f6edccc24c0ebf7b4ec86826d66259ba1cad8f0d.zip
Merge 0.9->trunk (who has been pushing to trunk?)
Diffstat (limited to 'tools/erlparse.lua')
-rw-r--r--tools/erlparse.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/erlparse.lua b/tools/erlparse.lua
index dc3a2f94..174585d3 100644
--- a/tools/erlparse.lua
+++ b/tools/erlparse.lua
@@ -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;