]> git.tdb.fi Git - libs/datafile.git/commitdiff
Recognize floating-point literals with an exponent but no decimal point
authorMikko Rasa <tdb@tdb.fi>
Wed, 1 Aug 2012 15:06:31 +0000 (18:06 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 1 Aug 2012 15:06:31 +0000 (18:06 +0300)
source/textparser.cpp

index c4eb03c7d91ef21e2b1af8d707e2f1363cc7fc4e..9bed08ac9e0ea5a154208b24cda76dc75925267b 100644 (file)
@@ -237,6 +237,8 @@ Token TextParser::parse_token()
                case DECIMAL:
                        if(c=='.')
                                state = FLOAT;
                case DECIMAL:
                        if(c=='.')
                                state = FLOAT;
+                       else if(c=='e' || c=='E')
+                               state = FLOATEXPINIT;
                        else if(!isdigit(c))
                                throw parse_error(buf);
                        break;
                        else if(!isdigit(c))
                                throw parse_error(buf);
                        break;