tools/erlparse: Handle decimal point in numbers.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 4 Aug 2012 18:55:52 +0000 (23:55 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sat, 4 Aug 2012 18:55:52 +0000 (23:55 +0500)
tools/erlparse.lua

index 287e45ba2543de7cd72520e35b70e9ff4135c63f..174585d338433d3c9db14a4f722ed4c029e41c68 100644 (file)
@@ -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;