diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-08-31 04:12:27 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-01 05:54:03 (GMT) |
commit | b2bae6c955440345ee4fac412b86d154a2ce540a (patch) | |
tree | 72154c90730097256af7b541bec8c107d650565c /src/declarative | |
parent | cddf6992c2a00f894bfa04c68eee8fabbb424b2c (diff) | |
download | Qt-b2bae6c955440345ee4fac412b86d154a2ce540a.zip Qt-b2bae6c955440345ee4fac412b86d154a2ce540a.tar.gz Qt-b2bae6c955440345ee4fac412b86d154a2ce540a.tar.bz2 |
The declarative parser should only save comment text (and not /*,*/,//)
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejslexer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp index 9024d50..1eb42e4 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer.cpp +++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp @@ -677,9 +677,9 @@ int Lexer::lex() 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 @@ int Lexer::lex() 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()+1, startlineno, startcolumn); + if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2); } break; |