Lexer: Skip also joined comments

Change-Id: Ic854958642bf1eedeb7d90ae74fb72993594b8d6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Orgad Shaneh
2014-02-04 23:33:08 +02:00
committed by Orgad Shaneh
parent 1bd1217da7
commit ddab33545c

View File

@@ -170,7 +170,7 @@ void Lexer::scan_helper(Token *tok)
break; break;
case T_COMMENT: case T_COMMENT:
case T_DOXY_COMMENT: { case T_DOXY_COMMENT: {
const int originalState = _state; const int originalKind = s._tokenKind;
while (_yychar) { while (_yychar) {
if (_yychar != '*') if (_yychar != '*')
@@ -188,16 +188,19 @@ void Lexer::scan_helper(Token *tok)
if (! f._scanCommentTokens) if (! f._scanCommentTokens)
goto _Lagain; goto _Lagain;
tok->f.kind = originalState; tok->f.kind = originalKind;
return; // done return; // done
} }
case T_CPP_COMMENT: 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.joined = true;
tok->f.kind = s._tokenKind; if (f._scanCommentTokens)
tok->f.kind = originalKind;
_state = 0; _state = 0;
scanCppComment((Kind)tok->f.kind); scanCppComment(originalKind);
return; return;
}
default: // Strings default: // Strings
tok->f.joined = true; tok->f.joined = true;
tok->f.kind = s._tokenKind; tok->f.kind = s._tokenKind;