src/declarative/qml/parser/qdeclarativejslexer.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp	Fri Sep 17 08:34:18 2010 +0300
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp	Mon Oct 04 01:19:32 2010 +0300
@@ -120,7 +120,7 @@
 
 void Lexer::setCode(const QString &c, int lineno)
 {
-    errmsg = QString();
+    errmsg.clear();
     yylineno = lineno;
     yycolumn = 1;
     restrKeyword = false;
@@ -677,9 +677,9 @@
                     setDone(Other);
                 } else
                     state = Start;
-                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
             } else if (current == 0) {
-                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
                 setDone(Eof);
             }
 
@@ -689,14 +689,14 @@
                 setDone(Bad);
                 err = UnclosedComment;
                 errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
-                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
             } else if (isLineTerminator()) {
                 shiftWindowsLineBreak();
                 yylineno++;
             } else if (current == '*' && next1 == '/') {
                 state = Start;
                 shift(1);
-                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2);
             }
 
             break;