]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/textparser.cpp
Restructure control statement processing
[libs/datafile.git] / source / textparser.cpp
index 225425b4e23166eea05fe0697f16974c327ab1c0..05521a90456a617e2e82b1fb664225d512a22af4 100644 (file)
@@ -35,7 +35,7 @@ TextParser::TextParser(Input &i, const string &s):
        ParserMode(i, s)
 { }
 
-Statement TextParser::parse(bool)
+Statement TextParser::parse()
 {
        return parse_statement(0);
 }
@@ -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;