From 6e0e2c78766de3ae57449866b74e111a2af893cf Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 4 Nov 2012 21:15:40 +0200 Subject: [PATCH] Fix comment handling A comment start sequence inside another comment should not change the comment type. --- source/textparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/textparser.cpp b/source/textparser.cpp index 225425b..afa78b9 100644 --- a/source/textparser.cpp +++ b/source/textparser.cpp @@ -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; -- 2.45.2