swig/Examples/test-suite/nested_scope.i
Thomas Reitmayr 7963445048 Add and improve Ruby test cases in the context of nesting and namespaces
This is done in preparation for adding namespace support to the Ruby
part of SWIG. Some existing test cases were reorganized or duplicated
for flat/nonflat nesting. For some a Ruby test script was added.
Finally the ruby/Makefile.in was improved so that for test cases
without an explicit test script, the generated wrapper library will
be loaded by the Ruby interpreter to ensure loading works fine.
2020-12-16 22:30:46 +01:00

63 lines
1,012 B
OpenEdge ABL

%module nested_scope
%inline %{
namespace ns {
// "global" is a case-insensitive keyword in PHP.
struct Global_ {
#ifdef __clang__
struct Outer {
struct Nested;
struct Nested {
int data;
};
};
struct Outer::Nested instance;
#else
struct Outer {
struct Nested;
};
struct Outer::Nested {
int data;
} instance;
#endif
};
}
class Outer1 {
struct Nested1;
public:
struct Nested2;
#ifdef __clang__
struct Nested2 {
int data;
};
#endif
template <class T> class AbstractClass;
class Real;
};
#ifndef __clang__
struct Outer1::Nested2 {
int data;
};
#endif
class Klass {
public:
template <class T> class AbstractClass;
class Real;
};
template <class T> class Klass::AbstractClass {
public:
virtual void Method() = 0;
virtual ~AbstractClass() {}
};
%}
%template(abstract_int) Klass::AbstractClass <int>;
%inline %{
class Klass::Real : public AbstractClass <int> {
public:
virtual void Method() {}
};
%}