Fix parser to ignore comments inside strings.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38186 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2014-11-20 00:29:56 +00:00
parent 8a9d120d5c
commit c900c7c4ce
2 changed files with 18 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2014-11-20 Riccardo Mottola <rm@gnu.org>
* Modules/Parsers/ProjectCenter/ObjCCommentHandler.m
Fix parser to ignore comments inside strings.
2014-10-07 Riccardo Mottola <rm@gnu.org>
* Framework/PCProjectManager.m

View file

@ -47,17 +47,20 @@
- (void)symbol:(unichar)element
{
if (_preChar == '/')
if (!_stringBegin)
{
if (element == '*')
_commentType = MultipleLineComment;
else if (element == '/')
_commentType = SingleLineComment;
}
else if ((element == '/') && (_preChar == '*'))
{
_commentType = NoComment;
if (_preChar == '/')
{
if (element == '*')
_commentType = MultipleLineComment;
else if (element == '/')
_commentType = SingleLineComment;
}
else if ((element == '/') && (_preChar == '*'))
{
_commentType = NoComment;
}
}
if (_commentType == NoComment)