forked from qt-creator/qt-creator
Added C-style comment folding.
This is a "back-port" for 57f2b3e44d from master
into 2.0.
Done-with: ckamm
This commit is contained in:
@@ -77,7 +77,7 @@ const _Tp *end(const _Tp (&a)[N])
|
||||
}
|
||||
|
||||
Scanner::Scanner()
|
||||
: _state(0),
|
||||
: _state(Normal),
|
||||
_scanComments(true)
|
||||
{
|
||||
}
|
||||
@@ -122,11 +122,6 @@ static bool isNumberChar(QChar ch)
|
||||
|
||||
QList<Token> Scanner::operator()(const QString &text, int startState)
|
||||
{
|
||||
enum {
|
||||
Normal = 0,
|
||||
MultiLineComment = 1
|
||||
};
|
||||
|
||||
_state = startState;
|
||||
QList<Token> tokens;
|
||||
|
||||
|
||||
@@ -77,13 +77,18 @@ public:
|
||||
class QMLJS_EXPORT Scanner
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
Normal = 0,
|
||||
MultiLineComment = 1
|
||||
};
|
||||
|
||||
Scanner();
|
||||
virtual ~Scanner();
|
||||
|
||||
bool scanComments() const;
|
||||
void setScanComments(bool scanComments);
|
||||
|
||||
QList<Token> operator()(const QString &text, int startState = 0);
|
||||
QList<Token> operator()(const QString &text, int startState = Normal);
|
||||
int state() const;
|
||||
|
||||
bool isKeyword(const QString &text) const;
|
||||
|
||||
Reference in New Issue
Block a user