QmlJS: Move commonly used functions to qmlutils.h.

Change-Id: I22376d96fe575bc00a55094c06af80e32a5587e6
Reviewed-on: http://codereview.qt-project.org/6238
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-07 14:04:06 +02:00
parent 737aaf02b4
commit a7f78991c9
30 changed files with 308 additions and 396 deletions

View File

@@ -151,27 +151,6 @@ private:
QStack<StringSet> m_propertyStack;
};
QMLJS_EXPORT QColor toQColor(const QString &qmlColorString);
QMLJS_EXPORT AST::SourceLocation locationFromRange(const AST::SourceLocation &start,
const AST::SourceLocation &end);
QMLJS_EXPORT AST::SourceLocation fullLocationForQualifiedId(AST::UiQualifiedId *);
QMLJS_EXPORT DiagnosticMessage errorMessage(const AST::SourceLocation &loc,
const QString &message);
QMLJS_EXPORT bool isValidBuiltinPropertyType(const QString &name);
template <class T>
DiagnosticMessage errorMessage(const T *node, const QString &message)
{
return DiagnosticMessage(DiagnosticMessage::Error,
locationFromRange(node->firstSourceLocation(),
node->lastSourceLocation()),
message);
}
} // namespace QmlJS
#endif // QMLJSCHECK_H