diff options
author | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2014-05-21 16:13:09 +0200 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2014-05-23 10:03:18 +0200 |
commit | 35128701cd5a051f49f233a25c94815e442d9ada (patch) | |
tree | a6a2feff9838299124d6187df33a3d262b48e024 /src/libs/qmljs/qmljsinterpreter.cpp | |
parent | 56080c4df253eee30083e1925abebcb3be990463 (diff) | |
download | qt-creator-35128701cd5a051f49f233a25c94815e442d9ada.tar.gz |
qmljs: exposing a bit more the existence of private value types
Change-Id: I85e29b0d60234407561ecbeb2883d68c1acb71d6
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/libs/qmljs/qmljsinterpreter.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsinterpreter.cpp | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 9497c62bfd..83d7f35d44 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -133,6 +133,10 @@ public: } }; +} // end of anonymous namespace + +namespace QmlJS { +namespace Internal { class MetaFunction: public FunctionValue { FakeMetaMethod _method; @@ -160,9 +164,13 @@ public: { return false; } + const MetaFunction *asMetaFunction() const + { + return this; + } }; - -} // end of anonymous namespace +} // namespace Internal +} // namespace QmlJS CppComponentValue::CppComponentValue(FakeMetaObject::ConstPtr metaObject, const QString &className, const QString &packageName, const ComponentVersion &componentVersion, @@ -238,7 +246,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const signatures = new QList<const Value *>; signatures->reserve(_metaObject->methodCount()); for (int index = 0; index < _metaObject->methodCount(); ++index) - signatures->append(new MetaFunction(_metaObject->method(index), valueOwner())); + signatures->append(new Internal::MetaFunction(_metaObject->method(index), valueOwner())); if (!_metaSignatures.testAndSetOrdered(0, signatures)) { delete signatures; #if QT_VERSION >= 0x050000 @@ -752,11 +760,46 @@ const ASTPropertyReference *Value::asAstPropertyReference() const return 0; } +const ASTVariableReference *Value::asAstVariableReference() const +{ + return 0; +} + +const Internal::QtObjectPrototypeReference *Value::asQtObjectPrototypeReference() const +{ + return 0; +} + const ASTSignal *Value::asAstSignal() const { return 0; } +const ASTFunctionValue *Value::asAstFunctionValue() const +{ + return 0; +} + +const Function *Value::asFunction() const +{ + return 0; +} + +const Internal::MetaFunction *Value::asMetaFunction() const +{ + return 0; +} + +const JSImportScope *Value::asJSImportScope() const +{ + return 0; +} + +const TypeScope *Value::asTypeScope() const +{ + return 0; +} + //////////////////////////////////////////////////////////////////////////////// // Values //////////////////////////////////////////////////////////////////////////////// @@ -1246,6 +1289,11 @@ bool Function::isVariadic() const return _isVariadic; } +const Function *Function::asFunction() const +{ + return this; +} + //////////////////////////////////////////////////////////////////////////////// // typing environment //////////////////////////////////////////////////////////////////////////////// @@ -1827,6 +1875,16 @@ ASTVariableReference::~ASTVariableReference() { } +const ASTVariableReference *ASTVariableReference::asAstVariableReference() const +{ + return this; +} + +const VariableDeclaration *ASTVariableReference::ast() const +{ + return _ast; +} + const Value *ASTVariableReference::value(ReferenceContext *referenceContext) const { // may be assigned to later @@ -1923,6 +1981,11 @@ bool ASTFunctionValue::isVariadic() const return _isVariadic; } +const ASTFunctionValue *ASTFunctionValue::asAstFunctionValue() const +{ + return this; +} + bool ASTFunctionValue::getSourceLocation(QString *fileName, int *line, int *column) const { *fileName = _doc->fileName(); @@ -2254,6 +2317,11 @@ void TypeScope::processMembers(MemberProcessor *processor) const } } +const TypeScope *TypeScope::asTypeScope() const +{ + return this; +} + JSImportScope::JSImportScope(const Imports *imports, ValueOwner *valueOwner) : ObjectValue(valueOwner) , _imports(imports) @@ -2300,6 +2368,11 @@ void JSImportScope::processMembers(MemberProcessor *processor) const } } +const JSImportScope *JSImportScope::asJSImportScope() const +{ + return this; +} + Imports::Imports(ValueOwner *valueOwner) : _typeScope(new TypeScope(this, valueOwner)) , _jsImportScope(new JSImportScope(this, valueOwner)) |