From 21a42232f015a38a020f7512822b78220efeab94 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 11 Apr 2018 21:20:20 -0400 Subject: [PATCH] allow "nn." or ".nn" for floating point numbers --- src/parser/parser.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/parser.l b/src/parser/parser.l index 6e0e022..b442427 100644 --- a/src/parser/parser.l +++ b/src/parser/parser.l @@ -117,7 +117,7 @@ sizeof return TOK_SIZEOF; '\\f' (void)'\f'; return TOK_CHAR_CONST; [0-9]+([uU][lL]?[lL]?)? return TOK_INT_CONST; 0[xX][0-9a-fA-F]+([uU][lL]?[lL]?)? return TOK_INT_CONST; -[0-9]*\.[0-9]*[fF]?([eE][0-9]+)? return TOK_FLOAT_CONST; +([0-9]+\.[0-9]*|\.[0-9]+)[fF]?([eE][0-9]+)? return TOK_FLOAT_CONST; \" { if (build_string != NULL)