forked from qt-creator/qt-creator
CPlusPlus: Make (sub-)languague selection more generic
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
22
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
22
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -81,24 +81,6 @@ int Lexer::state() const
|
||||
void Lexer::setState(int state)
|
||||
{ _state = state; }
|
||||
|
||||
bool Lexer::qtMocRunEnabled() const
|
||||
{ return f._qtMocRunEnabled; }
|
||||
|
||||
void Lexer::setQtMocRunEnabled(bool onoff)
|
||||
{ f._qtMocRunEnabled = onoff; }
|
||||
|
||||
bool Lexer::cxx0xEnabled() const
|
||||
{ return f._cxx0xEnabled; }
|
||||
|
||||
void Lexer::setCxxOxEnabled(bool onoff)
|
||||
{ f._cxx0xEnabled = onoff; }
|
||||
|
||||
bool Lexer::objCEnabled() const
|
||||
{ return f._objCEnabled; }
|
||||
|
||||
void Lexer::setObjCEnabled(bool onoff)
|
||||
{ f._objCEnabled = onoff; }
|
||||
|
||||
bool Lexer::isIncremental() const
|
||||
{ return f._isIncremental; }
|
||||
|
||||
@@ -557,7 +539,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
break;
|
||||
|
||||
default: {
|
||||
if (f._objCEnabled) {
|
||||
if (_languageFeatures.objCEnabled) {
|
||||
if (ch == '@' && _yychar >= 'a' && _yychar <= 'z') {
|
||||
const char *yytext = _currentChar;
|
||||
|
||||
@@ -780,7 +762,7 @@ void Lexer::scanIdentifier(Token *tok, unsigned extraProcessedChars)
|
||||
yyinp();
|
||||
int yylen = _currentChar - yytext;
|
||||
if (f._scanKeywords)
|
||||
tok->f.kind = classify(yytext, yylen, f._qtMocRunEnabled, f._cxx0xEnabled);
|
||||
tok->f.kind = classify(yytext, yylen, _languageFeatures);
|
||||
else
|
||||
tok->f.kind = T_IDENTIFIER;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user