summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkugwa <kugwa2000@gmail.com>2015-10-23 03:11:45 +0800
committerkugwa <kugwa2000@gmail.com>2015-10-23 03:11:45 +0800
commit54499f655255823658225227bf1650eaf85c17ec (patch)
tree0694e19a569cf35c77cee6afa39b1e5b517e3bf3
parentc6e6d5ea592eb3ac35f3c4d1293862d935ece0cf (diff)
downloadcompiler2015-54499f655255823658225227bf1650eaf85c17ec.tar
compiler2015-54499f655255823658225227bf1650eaf85c17ec.tar.gz
compiler2015-54499f655255823658225227bf1650eaf85c17ec.tar.bz2
compiler2015-54499f655255823658225227bf1650eaf85c17ec.tar.lz
compiler2015-54499f655255823658225227bf1650eaf85c17ec.tar.xz
compiler2015-54499f655255823658225227bf1650eaf85c17ec.tar.zst
compiler2015-54499f655255823658225227bf1650eaf85c17ec.zip
CONST_FLOAT can now match 1e9
-rw-r--r--lexer.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/lexer.l b/lexer.l
index 6b0294f..d34ed7b 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)))*\*+\/