]> git.tdb.fi Git - libs/datafile.git/commitdiff
Fix comment handling
authorMikko Rasa <tdb@tdb.fi>
Sun, 4 Nov 2012 19:15:40 +0000 (21:15 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 4 Nov 2012 19:15:40 +0000 (21:15 +0200)
A comment start sequence inside another comment should not change the
comment type.

source/textparser.cpp

index 225425b4e23166eea05fe0697f16974c327ab1c0..afa78b99927ddb67c581f47484b9cefc1c567a7e 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;