forked from qt-creator/qt-creator
Lexer: Skip also joined comments
Change-Id: Ic854958642bf1eedeb7d90ae74fb72993594b8d6 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
1bd1217da7
commit
ddab33545c
13
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
13
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -170,7 +170,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
break;
|
||||
case T_COMMENT:
|
||||
case T_DOXY_COMMENT: {
|
||||
const int originalState = _state;
|
||||
const int originalKind = s._tokenKind;
|
||||
|
||||
while (_yychar) {
|
||||
if (_yychar != '*')
|
||||
@@ -188,16 +188,19 @@ void Lexer::scan_helper(Token *tok)
|
||||
if (! f._scanCommentTokens)
|
||||
goto _Lagain;
|
||||
|
||||
tok->f.kind = originalState;
|
||||
tok->f.kind = originalKind;
|
||||
return; // done
|
||||
}
|
||||
case T_CPP_COMMENT:
|
||||
case T_CPP_DOXY_COMMENT:
|
||||
case T_CPP_DOXY_COMMENT: {
|
||||
const Kind originalKind = (Kind)s._tokenKind;
|
||||
tok->f.joined = true;
|
||||
tok->f.kind = s._tokenKind;
|
||||
if (f._scanCommentTokens)
|
||||
tok->f.kind = originalKind;
|
||||
_state = 0;
|
||||
scanCppComment((Kind)tok->f.kind);
|
||||
scanCppComment(originalKind);
|
||||
return;
|
||||
}
|
||||
default: // Strings
|
||||
tok->f.joined = true;
|
||||
tok->f.kind = s._tokenKind;
|
||||
|
||||
Reference in New Issue
Block a user