forked from qt-creator/qt-creator
QmlJS: Merge new parser from Qt 5.
Change-Id: I986df52b7ddb31e3bae1148eda881acc1829b102 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -97,13 +97,18 @@ Lexer::Lexer(Engine *engine)
|
||||
, _restrictedKeyword(false)
|
||||
, _terminator(false)
|
||||
, _followsClosingBrace(false)
|
||||
, _delimited(false)
|
||||
, _delimited(true)
|
||||
, _qmlMode(true)
|
||||
{
|
||||
if (engine)
|
||||
engine->setLexer(this);
|
||||
}
|
||||
|
||||
bool Lexer::qmlMode() const
|
||||
{
|
||||
return _qmlMode;
|
||||
}
|
||||
|
||||
QString Lexer::code() const
|
||||
{
|
||||
return _code;
|
||||
@@ -147,7 +152,7 @@ void Lexer::setCode(const QString &code, int lineno, bool qmlMode)
|
||||
_restrictedKeyword = false;
|
||||
_terminator = false;
|
||||
_followsClosingBrace = false;
|
||||
_delimited = false;
|
||||
_delimited = true;
|
||||
}
|
||||
|
||||
void Lexer::scanChar()
|
||||
@@ -176,6 +181,7 @@ int Lexer::lex()
|
||||
switch (_tokenKind) {
|
||||
case T_LBRACE:
|
||||
case T_SEMICOLON:
|
||||
case T_COLON:
|
||||
_delimited = true;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user