forked from qt-creator/qt-creator
Introduced T_CPP_COMMENT and T_CPP_DOXY_COMMENT to handle C++-style comments and improved CPPEditor::isInComment to handle the newly introduced tokens.
As side effect,this change should fix the regression we introduced in the "automagically" quote/brace insertion.
This commit is contained in:
@@ -428,7 +428,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
if (! f._scanCommentTokens)
|
||||
goto _Lagain;
|
||||
|
||||
tok->f.kind = doxy ? T_DOXY_COMMENT : T_COMMENT;
|
||||
tok->f.kind = doxy ? T_CPP_DOXY_COMMENT : T_CPP_COMMENT;
|
||||
|
||||
} else if (_yychar == '*') {
|
||||
yyinp();
|
||||
|
||||
@@ -54,6 +54,7 @@ CPLUSPLUS_BEGIN_NAMESPACE
|
||||
static const char *token_names[] = {
|
||||
(""), ("<error>"),
|
||||
|
||||
("<C++ comment>"), ("<C++ doxy comment>"),
|
||||
("<comment>"), ("<doxy comment>"),
|
||||
|
||||
("<identifier>"), ("<numeric literal>"), ("<char literal>"),
|
||||
|
||||
@@ -59,6 +59,8 @@ enum Kind {
|
||||
T_EOF_SYMBOL = 0,
|
||||
T_ERROR,
|
||||
|
||||
T_CPP_COMMENT,
|
||||
T_CPP_DOXY_COMMENT,
|
||||
T_COMMENT,
|
||||
T_DOXY_COMMENT,
|
||||
T_IDENTIFIER,
|
||||
@@ -297,7 +299,8 @@ public:
|
||||
{ return f.kind >= T_FIRST_KEYWORD && f.kind < T_FIRST_QT_KEYWORD; }
|
||||
|
||||
inline bool isComment() const
|
||||
{ return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT; }
|
||||
{ return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT ||
|
||||
f.kind == T_CPP_COMMENT || f.kind == T_CPP_DOXY_COMMENT; }
|
||||
|
||||
inline bool isObjCAtKeyword() const
|
||||
{ return f.kind >= T_FIRST_OBJC_AT_KEYWORD && f.kind <= T_LAST_OBJC_AT_KEYWORD; }
|
||||
|
||||
Reference in New Issue
Block a user