tools/erlparse: Handle decimal point in numbers.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 04 Aug 2012 23:55:52 +0500
changeset 5080 52767b1f057b
parent 5079 2ab99e239d45
child 5082 1ffc788c5696
tools/erlparse: Handle decimal point in numbers.
tools/erlparse.lua
--- a/tools/erlparse.lua	Sat Aug 04 23:23:49 2012 +0500
+++ b/tools/erlparse.lua	Sat Aug 04 23:55:52 2012 +0500
@@ -95,6 +95,12 @@
 	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;