forked from qt-creator/qt-creator
qmljs: codestyle fixes
Change-Id: I1b5a597d92e865d2235b15c62e3bbae362e5b7c0 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -30,59 +30,57 @@
|
|||||||
#ifndef QMLJS_INTERPRETER_H
|
#ifndef QMLJS_INTERPRETER_H
|
||||||
#define QMLJS_INTERPRETER_H
|
#define QMLJS_INTERPRETER_H
|
||||||
|
|
||||||
#include <qmljs/qmljsdocument.h>
|
|
||||||
#include <qmljs/qmljs_global.h>
|
#include <qmljs/qmljs_global.h>
|
||||||
#include <qmljs/qmljsconstants.h>
|
#include <qmljs/qmljsconstants.h>
|
||||||
|
#include <qmljs/qmljsdocument.h>
|
||||||
#include <qmljs/qmljsimportdependencies.h>
|
#include <qmljs/qmljsimportdependencies.h>
|
||||||
#include <utils/qtcoverride.h>
|
#include <utils/qtcoverride.h>
|
||||||
|
|
||||||
#include <QFileInfoList>
|
#include <QFileInfoList>
|
||||||
#include <QList>
|
|
||||||
#include <QString>
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QSet>
|
#include <QList>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
#include <QSet>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
class NameId;
|
|
||||||
class Document;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
class ValueOwner;
|
class ASTFunctionValue;
|
||||||
class Value;
|
|
||||||
class NullValue;
|
|
||||||
class UndefinedValue;
|
|
||||||
class UnknownValue;
|
|
||||||
class NumberValue;
|
|
||||||
class IntValue;
|
|
||||||
class RealValue;
|
|
||||||
class BooleanValue;
|
|
||||||
class StringValue;
|
|
||||||
class UrlValue;
|
|
||||||
class ObjectValue;
|
|
||||||
class FunctionValue;
|
|
||||||
class Reference;
|
|
||||||
class ColorValue;
|
|
||||||
class AnchorLineValue;
|
|
||||||
class Imports;
|
|
||||||
class TypeScope;
|
|
||||||
class JSImportScope;
|
|
||||||
class Context;
|
|
||||||
typedef QSharedPointer<const Context> ContextPtr;
|
|
||||||
class ReferenceContext;
|
|
||||||
class CppComponentValue;
|
|
||||||
class ASTObjectValue;
|
class ASTObjectValue;
|
||||||
class QmlEnumValue;
|
|
||||||
class QmlPrototypeReference;
|
|
||||||
class ASTVariableReference;
|
|
||||||
class ASTPropertyReference;
|
class ASTPropertyReference;
|
||||||
class ASTSignal;
|
class ASTSignal;
|
||||||
class ASTFunctionValue;
|
class ASTVariableReference;
|
||||||
|
class AnchorLineValue;
|
||||||
|
class BooleanValue;
|
||||||
|
class ColorValue;
|
||||||
|
class Context;
|
||||||
|
class CppComponentValue;
|
||||||
|
class Document;
|
||||||
class Function;
|
class Function;
|
||||||
|
class FunctionValue;
|
||||||
|
class Imports;
|
||||||
|
class IntValue;
|
||||||
|
class JSImportScope;
|
||||||
|
class NameId;
|
||||||
|
class NullValue;
|
||||||
|
class NumberValue;
|
||||||
|
class ObjectValue;
|
||||||
|
class QmlEnumValue;
|
||||||
|
class QmlPrototypeReference;
|
||||||
|
class RealValue;
|
||||||
|
class Reference;
|
||||||
|
class ReferenceContext;
|
||||||
|
class StringValue;
|
||||||
|
class TypeScope;
|
||||||
|
class UndefinedValue;
|
||||||
|
class UnknownValue;
|
||||||
|
class UrlValue;
|
||||||
|
class Value;
|
||||||
|
class ValueOwner;
|
||||||
|
typedef QSharedPointer<const Context> ContextPtr;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MetaFunction;
|
class MetaFunction;
|
||||||
@@ -422,7 +420,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
virtual const Value *value(ReferenceContext *referenceContext) const;
|
virtual const Value *value(ReferenceContext *referenceContext) const;
|
||||||
|
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
friend class ReferenceContext;
|
friend class ReferenceContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -482,9 +480,9 @@ private:
|
|||||||
bool checkPrototype(const ObjectValue *prototype, QSet<const ObjectValue *> *processed) const;
|
bool checkPrototype(const ObjectValue *prototype, QSet<const ObjectValue *> *processed) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
QHash<QString, const Value *> _members;
|
QHash<QString, const Value *> m_members;
|
||||||
QString _className;
|
QString m_className;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const Value *_prototype;
|
const Value *_prototype;
|
||||||
@@ -531,8 +529,8 @@ public:
|
|||||||
const CppComponentValue *owner() const;
|
const CppComponentValue *owner() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const CppComponentValue *_owner;
|
const CppComponentValue *m_owner;
|
||||||
int _enumIndex;
|
int m_enumIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -578,17 +576,17 @@ protected:
|
|||||||
bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const;
|
bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LanguageUtils::FakeMetaObject::ConstPtr _metaObject;
|
LanguageUtils::FakeMetaObject::ConstPtr m_metaObject;
|
||||||
const QString _moduleName;
|
const QString m_moduleName;
|
||||||
// _componentVersion is the version of the export
|
// _componentVersion is the version of the export
|
||||||
// _importVersion is the version it's imported as, used to find correct prototypes
|
// _importVersion is the version it's imported as, used to find correct prototypes
|
||||||
// needed in cases when B 1.0 has A 1.1 as prototype when imported as 1.1
|
// needed in cases when B 1.0 has A 1.1 as prototype when imported as 1.1
|
||||||
const LanguageUtils::ComponentVersion _componentVersion;
|
const LanguageUtils::ComponentVersion m_componentVersion;
|
||||||
const LanguageUtils::ComponentVersion _importVersion;
|
const LanguageUtils::ComponentVersion m_importVersion;
|
||||||
mutable QAtomicPointer< QList<const Value *> > _metaSignatures;
|
mutable QAtomicPointer< QList<const Value *> > m_metaSignatures;
|
||||||
mutable QAtomicPointer< QHash<QString, const ObjectValue *> > _signalScopes;
|
mutable QAtomicPointer< QHash<QString, const ObjectValue *> > m_signalScopes;
|
||||||
QHash<QString, const QmlEnumValue * > _enums;
|
QHash<QString, const QmlEnumValue * > m_enums;
|
||||||
int _metaObjectRevision;
|
int m_metaObjectRevision;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT FunctionValue: public ObjectValue
|
class QMLJS_EXPORT FunctionValue: public ObjectValue
|
||||||
@@ -643,11 +641,11 @@ public:
|
|||||||
const Function *asFunction() const QTC_OVERRIDE;
|
const Function *asFunction() const QTC_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueList _arguments;
|
ValueList m_arguments;
|
||||||
QStringList _argumentNames;
|
QStringList m_argumentNames;
|
||||||
const Value *_returnValue;
|
const Value *m_returnValue;
|
||||||
int _optionalNamedArgumentCount;
|
int m_optionalNamedArgumentCount;
|
||||||
bool _isVariadic;
|
bool m_isVariadic;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -704,10 +702,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// "Package.CppName ImportVersion" -> CppComponentValue
|
// "Package.CppName ImportVersion" -> CppComponentValue
|
||||||
QHash<QString, const CppComponentValue *> _objectsByQualifiedName;
|
QHash<QString, const CppComponentValue *> m_objectsByQualifiedName;
|
||||||
QHash<QString, QSet<LanguageUtils::FakeMetaObject::ConstPtr> > _fakeMetaObjectsByPackage;
|
QHash<QString, QSet<LanguageUtils::FakeMetaObject::ConstPtr> > m_fakeMetaObjectsByPackage;
|
||||||
const ObjectValue *_cppContextProperties;
|
const ObjectValue *m_cppContextProperties;
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertToNumber: protected ValueVisitor // ECMAScript ToInt()
|
class ConvertToNumber: protected ValueVisitor // ECMAScript ToInt()
|
||||||
@@ -729,8 +727,8 @@ protected:
|
|||||||
void visit(const FunctionValue *) QTC_OVERRIDE;
|
void visit(const FunctionValue *) QTC_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
const Value *_result;
|
const Value *m_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertToString: protected ValueVisitor // ECMAScript ToString
|
class ConvertToString: protected ValueVisitor // ECMAScript ToString
|
||||||
@@ -752,8 +750,8 @@ protected:
|
|||||||
void visit(const FunctionValue *) QTC_OVERRIDE;
|
void visit(const FunctionValue *) QTC_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
const Value *_result;
|
const Value *m_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertToObject: protected ValueVisitor // ECMAScript ToObject
|
class ConvertToObject: protected ValueVisitor // ECMAScript ToObject
|
||||||
@@ -775,8 +773,8 @@ protected:
|
|||||||
void visit(const FunctionValue *) QTC_OVERRIDE;
|
void visit(const FunctionValue *) QTC_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueOwner *_valueOwner;
|
ValueOwner *m_valueOwner;
|
||||||
const Value *_result;
|
const Value *m_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT TypeId: protected ValueVisitor
|
class QMLJS_EXPORT TypeId: protected ValueVisitor
|
||||||
@@ -812,14 +810,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
const Value *value(ReferenceContext *referenceContext) const QTC_OVERRIDE;
|
const Value *value(ReferenceContext *referenceContext) const QTC_OVERRIDE;
|
||||||
|
|
||||||
AST::UiQualifiedId *_qmlTypeName;
|
AST::UiQualifiedId *m_qmlTypeName;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT ASTVariableReference: public Reference
|
class QMLJS_EXPORT ASTVariableReference: public Reference
|
||||||
{
|
{
|
||||||
AST::VariableDeclaration *_ast;
|
AST::VariableDeclaration *m_ast;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTVariableReference(AST::VariableDeclaration *ast, const Document *doc, ValueOwner *valueOwner);
|
ASTVariableReference(AST::VariableDeclaration *ast, const Document *doc, ValueOwner *valueOwner);
|
||||||
@@ -833,10 +831,10 @@ private:
|
|||||||
|
|
||||||
class QMLJS_EXPORT ASTFunctionValue: public FunctionValue
|
class QMLJS_EXPORT ASTFunctionValue: public FunctionValue
|
||||||
{
|
{
|
||||||
AST::FunctionExpression *_ast;
|
AST::FunctionExpression *m_ast;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
QList<QString> _argumentNames;
|
QList<QString> m_argumentNames;
|
||||||
bool _isVariadic;
|
bool m_isVariadic;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTFunctionValue(AST::FunctionExpression *ast, const Document *doc, ValueOwner *valueOwner);
|
ASTFunctionValue(AST::FunctionExpression *ast, const Document *doc, ValueOwner *valueOwner);
|
||||||
@@ -854,9 +852,9 @@ public:
|
|||||||
|
|
||||||
class QMLJS_EXPORT ASTPropertyReference: public Reference
|
class QMLJS_EXPORT ASTPropertyReference: public Reference
|
||||||
{
|
{
|
||||||
AST::UiPublicMember *_ast;
|
AST::UiPublicMember *m_ast;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
QString _onChangedSlotName;
|
QString m_onChangedSlotName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTPropertyReference(AST::UiPublicMember *ast, const Document *doc, ValueOwner *valueOwner);
|
ASTPropertyReference(AST::UiPublicMember *ast, const Document *doc, ValueOwner *valueOwner);
|
||||||
@@ -864,8 +862,8 @@ public:
|
|||||||
|
|
||||||
const ASTPropertyReference *asAstPropertyReference() const QTC_OVERRIDE;
|
const ASTPropertyReference *asAstPropertyReference() const QTC_OVERRIDE;
|
||||||
|
|
||||||
AST::UiPublicMember *ast() const { return _ast; }
|
AST::UiPublicMember *ast() const { return m_ast; }
|
||||||
QString onChangedSlotName() const { return _onChangedSlotName; }
|
QString onChangedSlotName() const { return m_onChangedSlotName; }
|
||||||
|
|
||||||
bool getSourceLocation(QString *fileName, int *line, int *column) const QTC_OVERRIDE;
|
bool getSourceLocation(QString *fileName, int *line, int *column) const QTC_OVERRIDE;
|
||||||
|
|
||||||
@@ -875,10 +873,10 @@ private:
|
|||||||
|
|
||||||
class QMLJS_EXPORT ASTSignal: public FunctionValue
|
class QMLJS_EXPORT ASTSignal: public FunctionValue
|
||||||
{
|
{
|
||||||
AST::UiPublicMember *_ast;
|
AST::UiPublicMember *m_ast;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
QString _slotName;
|
QString m_slotName;
|
||||||
const ObjectValue *_bodyScope;
|
const ObjectValue *m_bodyScope;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTSignal(AST::UiPublicMember *ast, const Document *doc, ValueOwner *valueOwner);
|
ASTSignal(AST::UiPublicMember *ast, const Document *doc, ValueOwner *valueOwner);
|
||||||
@@ -886,9 +884,9 @@ public:
|
|||||||
|
|
||||||
const ASTSignal *asAstSignal() const QTC_OVERRIDE;
|
const ASTSignal *asAstSignal() const QTC_OVERRIDE;
|
||||||
|
|
||||||
AST::UiPublicMember *ast() const { return _ast; }
|
AST::UiPublicMember *ast() const { return m_ast; }
|
||||||
QString slotName() const { return _slotName; }
|
QString slotName() const { return m_slotName; }
|
||||||
const ObjectValue *bodyScope() const { return _bodyScope; }
|
const ObjectValue *bodyScope() const { return m_bodyScope; }
|
||||||
|
|
||||||
// FunctionValue interface
|
// FunctionValue interface
|
||||||
int namedArgumentCount() const QTC_OVERRIDE;
|
int namedArgumentCount() const QTC_OVERRIDE;
|
||||||
@@ -901,12 +899,12 @@ public:
|
|||||||
|
|
||||||
class QMLJS_EXPORT ASTObjectValue: public ObjectValue
|
class QMLJS_EXPORT ASTObjectValue: public ObjectValue
|
||||||
{
|
{
|
||||||
AST::UiQualifiedId *_typeName;
|
AST::UiQualifiedId *m_typeName;
|
||||||
AST::UiObjectInitializer *_initializer;
|
AST::UiObjectInitializer *m_initializer;
|
||||||
const Document *_doc;
|
const Document *m_doc;
|
||||||
QList<ASTPropertyReference *> _properties;
|
QList<ASTPropertyReference *> m_properties;
|
||||||
QList<ASTSignal *> _signals;
|
QList<ASTSignal *> m_signals;
|
||||||
ASTPropertyReference *_defaultPropertyRef;
|
ASTPropertyReference *m_defaultPropertyRef;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTObjectValue(AST::UiQualifiedId *typeName,
|
ASTObjectValue(AST::UiQualifiedId *typeName,
|
||||||
@@ -958,12 +956,12 @@ public:
|
|||||||
AST::UiImport *ast() const;
|
AST::UiImport *ast() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ImportType::Enum _type;
|
ImportType::Enum m_type;
|
||||||
LanguageUtils::ComponentVersion _version;
|
LanguageUtils::ComponentVersion m_version;
|
||||||
QString _name;
|
QString m_name;
|
||||||
QString _path;
|
QString m_path;
|
||||||
QString _as;
|
QString m_as;
|
||||||
AST::UiImport *_ast;
|
AST::UiImport *m_ast;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT Import {
|
class QMLJS_EXPORT Import {
|
||||||
@@ -995,7 +993,7 @@ public:
|
|||||||
void processMembers(MemberProcessor *processor) const QTC_OVERRIDE;
|
void processMembers(MemberProcessor *processor) const QTC_OVERRIDE;
|
||||||
const TypeScope *asTypeScope() const QTC_OVERRIDE;
|
const TypeScope *asTypeScope() const QTC_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
const Imports *_imports;
|
const Imports *m_imports;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT JSImportScope: public ObjectValue
|
class QMLJS_EXPORT JSImportScope: public ObjectValue
|
||||||
@@ -1009,7 +1007,7 @@ public:
|
|||||||
void processMembers(MemberProcessor *processor) const QTC_OVERRIDE;
|
void processMembers(MemberProcessor *processor) const QTC_OVERRIDE;
|
||||||
const JSImportScope *asJSImportScope() const QTC_OVERRIDE;
|
const JSImportScope *asJSImportScope() const QTC_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
const Imports *_imports;
|
const Imports *m_imports;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT Imports
|
class QMLJS_EXPORT Imports
|
||||||
@@ -1036,10 +1034,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
// holds imports in the order they appeared,
|
// holds imports in the order they appeared,
|
||||||
// lookup order is back to front
|
// lookup order is back to front
|
||||||
QList<Import> _imports;
|
QList<Import> m_imports;
|
||||||
TypeScope *_typeScope;
|
TypeScope *m_typeScope;
|
||||||
JSImportScope *_jsImportScope;
|
JSImportScope *m_jsImportScope;
|
||||||
bool _importFailed;
|
bool m_importFailed;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlJS
|
} // namespace QmlJS
|
||||||
|
|||||||
Reference in New Issue
Block a user