]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/textparser.cpp
Restructure control statement processing
[libs/datafile.git] / source / textparser.cpp
index c4eb03c7d91ef21e2b1af8d707e2f1363cc7fc4e..05521a90456a617e2e82b1fb664225d512a22af4 100644 (file)
@@ -124,9 +124,9 @@ Token TextParser::parse_token()
                c = in.get();
                int next = in.peek();
 
-               if(c=='/' && next=='/')
+               if(c=='/' && next=='/' && !comment)
                        comment = 1;
-               else if(c=='/' && next=='*')
+               else if(c=='/' && next=='*' && !comment)
                        comment = 2;
                else if(c=='\n' && comment==1)
                        comment = 0;
@@ -237,6 +237,8 @@ Token TextParser::parse_token()
                case DECIMAL:
                        if(c=='.')
                                state = FLOAT;
+                       else if(c=='e' || c=='E')
+                               state = FLOATEXPINIT;
                        else if(!isdigit(c))
                                throw parse_error(buf);
                        break;