forked from qt-creator/qt-creator
QmlJS: Make the Scanner recognize regular expression literals.
Task-number: QTCREATORBUG-4566 Change-Id: I48b08f8eee79b25d0ebe186b996cdcb8f1979e3d Reviewed-on: http://codereview.qt.nokia.com/38 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -116,6 +116,10 @@ void Highlighter::highlightBlock(const QString &text)
|
||||
setFormat(token.offset, token.length, m_formats[CommentFormat]);
|
||||
break;
|
||||
|
||||
case Token::RegExp:
|
||||
setFormat(token.offset, token.length, m_formats[StringFormat]);
|
||||
break;
|
||||
|
||||
case Token::LeftParenthesis:
|
||||
onOpeningParenthesis('(', token.offset, index == 0);
|
||||
break;
|
||||
@@ -229,7 +233,8 @@ void Highlighter::highlightBlock(const QString &text)
|
||||
|
||||
switch (token.kind) {
|
||||
case Token::Comment:
|
||||
case Token::String: {
|
||||
case Token::String:
|
||||
case Token::RegExp: {
|
||||
int i = token.begin(), e = token.end();
|
||||
while (i < e) {
|
||||
const QChar ch = text.at(i);
|
||||
|
||||
Reference in New Issue
Block a user