summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parser.l2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f3c1822a..582151d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-20 Kaz Kylheku <kaz@kylheku.com>
+
+ * parser.l (FLO): Adjusted syntax of floating point numbers
+ to allow leading or trailing decimal.
+
2012-03-19 Kaz Kylheku <kaz@kylheku.com>
* stream.c (vformat): num_buf increased to 256 because we
diff --git a/parser.l b/parser.l
index 58276605..d8fd9150 100644
--- a/parser.l
+++ b/parser.l
@@ -150,7 +150,7 @@ static wchar_t num_esc(char *num)
SYM [a-zA-Z0-9_]+
NUM [+\-]?[0-9]+
-FLO [+\-]?[0-9]+([.][0-9]+)?([eE][+-]?[0-9]+)?
+FLO [+\-]?([0-9]+[.]?[0-9]*|[0-9]*[.][0-9]+)([eE][+-]?[0-9]+)?
BSCHR [a-zA-Z0-9!$%&*+\-<=>?\\^_~]
BSYM {BSCHR}({BSCHR}|#)*
NSCHR [a-zA-Z0-9!$%&*+\-<=>?\\^_~/]