Commit 530d03b3 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents ad294f84 3ec6f585
...@@ -63,7 +63,8 @@ bool SimpleToken::isKeyword() const ...@@ -63,7 +63,8 @@ bool SimpleToken::isKeyword() const
bool SimpleToken::isComment() const bool SimpleToken::isComment() const
{ {
return _kind == T_COMMENT || _kind == T_DOXY_COMMENT; return _kind == T_COMMENT || _kind == T_DOXY_COMMENT ||
_kind == T_CPP_COMMENT || _kind == T_CPP_DOXY_COMMENT;
} }
bool SimpleToken::isObjCAtKeyword() const bool SimpleToken::isObjCAtKeyword() const
......
...@@ -1543,7 +1543,16 @@ bool CPPEditor::isInComment(const QTextCursor &cursor) const ...@@ -1543,7 +1543,16 @@ bool CPPEditor::isInComment(const QTextCursor &cursor) const
const SimpleToken tk = tokenUnderCursor(cursor); const SimpleToken tk = tokenUnderCursor(cursor);
if (tk.isComment()) { if (tk.isComment()) {
const int pos = cursor.selectionEnd(); const int pos = cursor.selectionEnd() - cursor.block().position();
if (pos == tk.end()) {
if (tk.is(T_CPP_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))
return true;
const int state = cursor.block().userState() & 0xFF;
if (state > 0)
return true;
}
if (pos < tk.end()) if (pos < tk.end())
return true; return true;
......
...@@ -138,7 +138,7 @@ void CppHighlighter::highlightBlock(const QString &text) ...@@ -138,7 +138,7 @@ void CppHighlighter::highlightBlock(const QString &text)
else if (tk.isComment()) { else if (tk.isComment()) {
if (tk.is(T_COMMENT)) if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT))
setFormat(tk.position(), tk.length(), m_formats[CppCommentFormat]); setFormat(tk.position(), tk.length(), m_formats[CppCommentFormat]);
else // a doxygen comment else // a doxygen comment
......
...@@ -141,7 +141,8 @@ OTHER_FILES += ProjectExplorer.pluginspec ...@@ -141,7 +141,8 @@ OTHER_FILES += ProjectExplorer.pluginspec
mac:LIBS += -framework Carbon mac:LIBS += -framework Carbon
SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60) win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
!isEmpty(SUPPORT_QT_S60) { !isEmpty(SUPPORT_QT_S60) {
message("Adding experimental support for Qt/S60 applications.") message("Adding experimental support for Qt/S60 applications.")
DEFINES += QTCREATOR_WITH_S60 DEFINES += QTCREATOR_WITH_S60
......
...@@ -428,7 +428,7 @@ void Lexer::scan_helper(Token *tok) ...@@ -428,7 +428,7 @@ void Lexer::scan_helper(Token *tok)
if (! f._scanCommentTokens) if (! f._scanCommentTokens)
goto _Lagain; 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 == '*') { } else if (_yychar == '*') {
yyinp(); yyinp();
......
...@@ -54,6 +54,7 @@ CPLUSPLUS_BEGIN_NAMESPACE ...@@ -54,6 +54,7 @@ CPLUSPLUS_BEGIN_NAMESPACE
static const char *token_names[] = { static const char *token_names[] = {
(""), ("<error>"), (""), ("<error>"),
("<C++ comment>"), ("<C++ doxy comment>"),
("<comment>"), ("<doxy comment>"), ("<comment>"), ("<doxy comment>"),
("<identifier>"), ("<numeric literal>"), ("<char literal>"), ("<identifier>"), ("<numeric literal>"), ("<char literal>"),
......
...@@ -59,6 +59,8 @@ enum Kind { ...@@ -59,6 +59,8 @@ enum Kind {
T_EOF_SYMBOL = 0, T_EOF_SYMBOL = 0,
T_ERROR, T_ERROR,
T_CPP_COMMENT,
T_CPP_DOXY_COMMENT,
T_COMMENT, T_COMMENT,
T_DOXY_COMMENT, T_DOXY_COMMENT,
T_IDENTIFIER, T_IDENTIFIER,
...@@ -297,7 +299,8 @@ public: ...@@ -297,7 +299,8 @@ public:
{ return f.kind >= T_FIRST_KEYWORD && f.kind < T_FIRST_QT_KEYWORD; } { return f.kind >= T_FIRST_KEYWORD && f.kind < T_FIRST_QT_KEYWORD; }
inline bool isComment() const 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 inline bool isObjCAtKeyword() const
{ return f.kind >= T_FIRST_OBJC_AT_KEYWORD && f.kind <= T_LAST_OBJC_AT_KEYWORD; } { return f.kind >= T_FIRST_OBJC_AT_KEYWORD && f.kind <= T_LAST_OBJC_AT_KEYWORD; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment