From 278478c027b75e3716ef5a21ecca332f3d671a8a Mon Sep 17 00:00:00 2001 From: kugwa Date: Fri, 23 Oct 2015 03:50:35 +0800 Subject: CONST_FLOAT now matchs some fucking cases like '1.' or '.1' --- lexer.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lexer.l b/lexer.l index d34ed7b..c670529 100644 --- a/lexer.l +++ b/lexer.l @@ -50,7 +50,7 @@ WS [ \t]+ /* You need to define the following RE's */ CONST_INT [+-]?{digit}+ -CONST_FLOAT [+-]?(([0-9]+|[0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?) +CONST_FLOAT [+-]?(([0-9]+\.?|[0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?) /* {digit}+\.{digit}+ */ CONST_STRING \"([^\"\n]|(\\.))*\" COMMENT \/\*([^*]|\n|(\*+([^*/]|\n)))*\*+\/ -- cgit v1.2.3