Collect the source locations of the single and multiline comments.
authorRoberto Raggi <roberto.raggi@nokia.com>
Mon, 22 Aug 2011 14:36:04 +0000 (16:36 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 30 Aug 2011 11:18:28 +0000 (13:18 +0200)
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>
src/declarative/qml/parser/qdeclarativejslexer.cpp

index b59d7cd..d466140 100644 (file)
@@ -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();