aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser/qdeclarativejslexer.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-08-22 16:36:04 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-30 13:18:28 +0200
commitc7a9493730b93f0e19705bdb02729e15b9955117 (patch)
treeb86d6e18d1669e4862bc3979d9e0088d77b14f9a /src/declarative/qml/parser/qdeclarativejslexer.cpp
parenta63cc12645b173be7b2442edb8c40e958563833b (diff)
Collect the source locations of the single and multiline comments.
Change-Id: I7a8f2eec7a45f7a9a1212680f477cc5edd2aaad5 Reviewed-on: http://codereview.qt.nokia.com/3796 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/declarative/qml/parser/qdeclarativejslexer.cpp')
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index b59d7cd2d6..d466140949 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -390,6 +390,12 @@ again:
scanChar();
if (_char == QLatin1Char('/')) {
scanChar();
+
+ if (_engine) {
+ _engine->addComment(tokenOffset() + 2, _codePtr - _tokenStartPtr - 1 - 4,
+ tokenStartLine(), tokenStartColumn() + 2);
+ }
+
goto again;
}
} else {
@@ -400,6 +406,10 @@ again:
while (!_char.isNull() && _char != QLatin1Char('\n')) {
scanChar();
}
+ if (_engine) {
+ _engine->addComment(tokenOffset() + 2, _codePtr - _tokenStartPtr - 1 - 2,
+ tokenStartLine(), tokenStartColumn() + 2);
+ }
goto again;
} if (_char == QLatin1Char('=')) {
scanChar();