forked from qt-creator/qt-creator
C++: Inline Lexer::control()
Change-Id: Ia37ec33fb031fdea4ad1890fcea3a80b7b46e272 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
10
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
10
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -29,6 +29,7 @@ using namespace CPlusPlus;
|
||||
|
||||
Lexer::Lexer(TranslationUnit *unit)
|
||||
: _translationUnit(unit),
|
||||
_control(unit->control()),
|
||||
_state(State_Default),
|
||||
_flags(0),
|
||||
_currentLine(1)
|
||||
@@ -40,6 +41,7 @@ Lexer::Lexer(TranslationUnit *unit)
|
||||
|
||||
Lexer::Lexer(const char *firstChar, const char *lastChar)
|
||||
: _translationUnit(0),
|
||||
_control(0),
|
||||
_state(State_Default),
|
||||
_flags(0),
|
||||
_currentLine(1)
|
||||
@@ -54,14 +56,6 @@ Lexer::~Lexer()
|
||||
TranslationUnit *Lexer::translationUnit() const
|
||||
{ return _translationUnit; }
|
||||
|
||||
Control *Lexer::control() const
|
||||
{
|
||||
if (_translationUnit)
|
||||
return _translationUnit->control();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Lexer::setSource(const char *firstChar, const char *lastChar)
|
||||
{
|
||||
_firstChar = firstChar;
|
||||
|
3
src/libs/3rdparty/cplusplus/Lexer.h
vendored
3
src/libs/3rdparty/cplusplus/Lexer.h
vendored
@@ -43,7 +43,7 @@ public:
|
||||
Lexer(const char *firstChar, const char *lastChar);
|
||||
~Lexer();
|
||||
|
||||
Control *control() const;
|
||||
Control *control() const { return _control; }
|
||||
TranslationUnit *translationUnit() const;
|
||||
|
||||
bool qtMocRunEnabled() const;
|
||||
@@ -118,6 +118,7 @@ private:
|
||||
};
|
||||
|
||||
TranslationUnit *_translationUnit;
|
||||
Control *_control;
|
||||
const char *_firstChar;
|
||||
const char *_currentChar;
|
||||
const char *_lastChar;
|
||||
|
Reference in New Issue
Block a user