diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-09-08 13:43:43 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-09-08 13:43:43 (GMT) |
commit | 7731e5f7d33d3ec251299c7651e777d7e0054573 (patch) | |
tree | b326e16b1ba93f53e7b5b91f69a61a13a97e24a2 /src/declarative/qml/parser/qmljsengine_p.cpp | |
parent | 914e331be160347a031cef131ac1cbc0a6787be0 (diff) | |
download | Qt-7731e5f7d33d3ec251299c7651e777d7e0054573.zip Qt-7731e5f7d33d3ec251299c7651e777d7e0054573.tar.gz Qt-7731e5f7d33d3ec251299c7651e777d7e0054573.tar.bz2 |
Added an option to the lexer to tell the engine of all comments in a QML
file.
Diffstat (limited to 'src/declarative/qml/parser/qmljsengine_p.cpp')
-rw-r--r-- | src/declarative/qml/parser/qmljsengine_p.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/qml/parser/qmljsengine_p.cpp b/src/declarative/qml/parser/qmljsengine_p.cpp index 02d9b9c..eab8944 100644 --- a/src/declarative/qml/parser/qmljsengine_p.cpp +++ b/src/declarative/qml/parser/qmljsengine_p.cpp @@ -178,6 +178,12 @@ Engine::~Engine() QSet<NameId> Engine::literals() const { return _literals; } +void Engine::addComment(int pos, int len, int line, int col) +{ if (len > 0) _comments.append(QmlJS::AST::SourceLocation(pos, len, line, col)); } + +QList<QmlJS::AST::SourceLocation> Engine::comments() const +{ return _comments; } + NameId *Engine::intern(const QChar *u, int s) { return const_cast<NameId *>(&*_literals.insert(NameId(u, s))); } |