forked from qt-creator/qt-creator
qmljs: added qmljsconstants.h
Moved Document::Language, Import::Type and StaticAnalysis::Severity enums to qmljsconstants.h and renamed values removing the redundant part. Thus the effective length changed little or improved (Document::QmlLanguage => Language::Qml). The separate file allows better reuse of enum values without introducing circular dependencies. Change-Id: I5186d7c04f5d3f6c289068b919be5ff1ff118326 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "qmljsglobal_p.h"
|
||||
#include "qmljsastfwd_p.h"
|
||||
#include "qmljsmemorypool_p.h"
|
||||
#include <qmljs/qmljsconstants.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QSet>
|
||||
@@ -59,21 +60,19 @@ class MemoryPool;
|
||||
class QML_PARSER_EXPORT DiagnosticMessage
|
||||
{
|
||||
public:
|
||||
enum Kind { Warning, Error };
|
||||
|
||||
DiagnosticMessage()
|
||||
: kind(Error) {}
|
||||
: kind(Severity::Error) {}
|
||||
|
||||
DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message)
|
||||
DiagnosticMessage(Severity::Enum kind, const AST::SourceLocation &loc, const QString &message)
|
||||
: kind(kind), loc(loc), message(message) {}
|
||||
|
||||
bool isWarning() const
|
||||
{ return kind == Warning; }
|
||||
{ return kind == Severity::Warning; }
|
||||
|
||||
bool isError() const
|
||||
{ return kind == Error; }
|
||||
{ return kind == Severity::Error; }
|
||||
|
||||
Kind kind;
|
||||
Severity::Enum kind;
|
||||
AST::SourceLocation loc;
|
||||
QString message;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user