From 87bbb2a94317f7a4e3c0f473e38131d2b7a38a9a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 4 Aug 2012 23:23:49 +0500 Subject: tools/erlparse: Fix erlang string escape sequences. --- tools/erlparse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/erlparse.lua b/tools/erlparse.lua index dc3a2f94..287e45ba 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; -- cgit v1.2.3 From a5b04b23ec4dbbe5674b0ab596427193877923d6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 4 Aug 2012 23:55:52 +0500 Subject: tools/erlparse: Handle decimal point in numbers. --- tools/erlparse.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/erlparse.lua b/tools/erlparse.lua index 287e45ba..174585d3 100644 --- a/tools/erlparse.lua +++ b/tools/erlparse.lua @@ -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; -- cgit v1.2.3