Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
c5f4983b
Commit
c5f4983b
authored
Jan 29, 2010
by
Roberto Raggi
Browse files
Highlight `import' keyword.
parent
14207aa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljshighlighter.cpp
View file @
c5f4983b
...
...
@@ -115,7 +115,7 @@ void QScriptHighlighter::highlightBlock(const QString &text)
break
;
case
Token
::
Identifier
:
{
if
(
maybeQmlKeyword
(
text
.
midRef
(
token
.
offset
,
token
.
length
)))
{
if
(
m_duiEnabled
&&
maybeQmlKeyword
(
text
.
midRef
(
token
.
offset
,
token
.
length
)))
{
// check the previous token
if
(
index
==
0
||
tokens
.
at
(
index
-
1
).
isNot
(
Token
::
Dot
))
{
if
(
index
+
1
==
tokens
.
size
()
||
tokens
.
at
(
index
+
1
).
isNot
(
Token
::
Colon
))
{
...
...
@@ -241,6 +241,8 @@ bool QScriptHighlighter::maybeQmlKeyword(const QStringRef &text) const
return
true
;
}
else
if
(
ch
==
QLatin1Char
(
'r'
)
&&
text
==
QLatin1String
(
"readonly"
))
{
return
true
;
}
else
if
(
ch
==
QLatin1Char
(
'i'
)
&&
text
==
QLatin1String
(
"import"
))
{
return
true
;
}
else
{
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment