This is the Doxygen work begun in Google Summer of Code projects 2008
and 2012 and subsequently improved by numerous contributors.
* vadz-doxygen: (314 commits)
Add changes entry for Doxygen support
Add some missing doctype tyemaps
Doxygen warnings cleanup
Move doxygen warning numbers
Add Python doxygen example
Doxygen example
Add Doxygen to include paths
Doxygen source rename
More merge fixes from doxygen branches
Correct python example headers
Correct source code headers
Another merge fix from doxygen branches
Java enums output format fixes
Add omitted doxygen_parsing_enums testcase
PEP8 conformance for comment verifier module
Clean up merge problem
Doxygen html tweaks
Update html chapter numbering for added Doxygen chapter
Fixes to makechap.py to detect ill-formed headers
html fixes for Doxygen
Add missing CPlusPlus17.html file
Format files to unix format
Doxygen testcase tweak to match that in the html docs
Doxygen html documentation updates and corrections
Remove doxygen Examples subdirectory
Beautify doxygen source code
Code formatting fixes in doxygen code
Remove unused doxygen code
new_node refactor
Various merge fixes in doxygen branches
Unused variable warning fix
Fix wrongly resetting indent after formulae in Doxygen comments
Add support for doxygen:alias feature
Get rid of meaningless return type of DoxygenParser methods
Return enum, not untyped int, when classifying Doxygen commands
Get rid of unnecessary "typedef enum" in C++ code
Use slash, not backslash, in "C/C++" in the documentation
Replace literal "<" with "<" in HTML documentation
Fix broken link to java.sun.com in Doxygen documentation
Fix using com.sun.tools.javadoc package under macOS
Fix error reporting for special characters in Doxygen parsing code
Switch Python Doxygen unit tests to use inspect.getdoc()
Use correct separator in Java class path under Windows.
Remove executable permission from appveyor.yml.
Use JAVA_HOME value in configure to detect Java.
Display JAVA_HOME value in "make java_version".
Fix harmless MSVC warning in DoxygenTranslator code.
Reset "_last" for all but first enum elements.
Don't duplicate Javadoc from global enum Doxygen comments twice.
Move Doxygen comments concatenation from the parser to the lexer.
Fix shift/reduce conflicts in Doxygen pre/post comment parsing.
Rewrote part of the grammar dealing with Doxygen comments for enums.
No changes, just remove spurious white space only differences.
Move Doxygen comment mangling from the parser to the lexer.
Merge "-builtin" autodoc bugs workarounds from master into test.
Quote JAVA_HOME variable value in Java test suite makefile.
Remove unused C_COMMENT_STRING terminal from the grammar.
Fix missing returns in the Doxygen test suite code.
Fix trimming whitespace from Doxygen comments.
Remove code not doing anything from PyDocConverter.
Remove unused <sstream> header.
Remove unreferenced struct declaration.
Remove unused Swig_warn() function.
Remove any whitespace before ignored Doxygen commands.
Remove trailing space from one of Doxygen tests.
Fix autodoc strings generated in Python builtin case and the test.
Fix Doxygen unit test in Python "-builtin" case.
Use class docstrings in "-builtin" Python case.
Don't indent Doxygen doc strings in generated Python code.
Add a possibility to flexibly ignore custom Doxygen tags.
Stop completely ignoring many Doxygen comments.
Fix structural Doxygen comment recognition in the parser.
No changes, just make checking for Doxygen structural tags more sane.
Use "//", not "#", for comments in SWIG input.
Allow upper case letters and digits in Doxygen words.
Pass the node the Doxygen comment is attached to to DoxygenParser.
Get rid of findCommand() which duplicaed commandBelongs().
Recognize unknown Doxygen tags correctly.
No real changes, just pass original command to commandBelongs().
Describe Doxygen-specific %features in a single place.
Give warnings for unknown Doxygen commands in Doxygen parser.
Document the return type when translating Doxygen @return to Python.
Fix translated Doxygen comments for overloaded functions in Python.
Also merge Doxygen comments for overloaded constructors in Python.
Allow using enum elements as default values for Python functions.
Don't always use "*args" for all Python wrapper functions.
No real changes, just make PYTHON::check_kwargs() const.
Refactor: move makeParameterName() to common Language base class.
Remove long line wrapping from Python parameter list generation code.
Simplify and make more efficient building Python docstrings.
Translate Doxygen code blocks to Sphinx code blocks.
Add a simple test of multiple parameters to Doxygen test suite.
Make Python parameters types hyperlinks in the doc strings.
Make Language::classLookup() and enumLookup() static.
Fix arguments of @param, @return etc translations to Python.
Remove unused method from PyDocConverter.
No real changes, just remove an unnecessary variable.
Preserve relative indentation when parsing Doxygen comments.
Use Sphinx-friendly formatting for overloaded functions documentation.
Add poor man trailing white space detection to Doxygen Python tests.
...
Use std::move on this pointer as the default approach to supporting
rvalue ref-qualifiers if a user really wants to wrap.
std::move requires <memory> headers so add swigfragments.swg for all
languages to use common fragments. Just header file fragments for now.
Internally, handle function ref-qualifiers in the function decl type string.
Needed for a whole host of things to work like %feature and %rename.
Add %feature %rename and %ignore testing for ref-qualifiers.
Was not generating code that compiled when the variable was not
a simple member pointer, for example,
a const reference member pointer:
short (Funcs::* const& cc7)(bool) const = cc1;
Fixes#1059
Methods with rvalue ref-qualifiers are ignored by default as it is not
possible to have an rvalue temporary from the target language (which is
needed to call the rvalue ref-qualified method).
A warning 405 is shown mentioning the ignored rvalue ref-qualifier method
which can be seen with the -Wextra option.
cpp_refqualifier.i:15: Warning 405: Method with rvalue ref-qualifier ignored h() const &&.
Usually rvalue and lvalue ref-qualifier overloaded methods are written - the
lvalue method will then be wrapped.
* templates-scope-enforcement:
Test a few %template errors
Add using declarations to templates into typedef table.
Fix type lookup in the presence of using directives and using declarations
More docs on %template
Testcase fix for nameclash in php
%template scope enforcement and class definition fixes
Template documentation tweaks
More consistent formatting of examples in documentation
More consistent formatting of examples in documentation
Documentation corrections to use targetlang formatting
More consistent formatting of examples in documentation
More consistent formatting of examples in documentation
More consistent formatting of examples in documentation
Namespace documentation minor corrections
Improve description of template_parameters_resolve
Minor code optimisation in template_parameters_resolve
Fix scope lookup for template parameters containing unary scope operators
Typemap change for templates
Fixes#1051. Using declarations to templates were missing in SWIG's internal typedef tables.
This led to a few problems, such as, templates that did not instantiate and generated
C++ code that did not compile as SWIG did not know what scope the template was
in. This happened mostly when a using declaration was used on a template type in a
completely unrelated namespace.
Fix some cases of type lookup failure via a combination of both using directives and
using declarations resulting in C++ code that did not compile as the generated type was
not fully qualified for use in the global namespace. Example below:
namespace Space5 {
namespace SubSpace5 {
namespace SubSubSpace5 {
struct F {};
}
}
using namespace SubSpace5;
using SubSubSpace5::F;
void func(SubSubSpace5::F f);
}
The scoping rules around %template have been specified and enforced.
The %template directive for a class template is the equivalent to an
explicit instantiation of a C++ class template. The scope for a valid
%template instantiation is now the same as the scope required for a
valid explicit instantiation of a C++ template. A definition of the
template for the explicit instantiation must be in scope where the
instantiation is declared and must not be enclosed within a different
namespace.
For example, a few %template and explicit instantiations of std::vector
are shown below:
// valid
namespace std {
%template(vin) vector<int>;
template class vector<int>;
}
// valid
using namespace std;
%template(vin) vector<int>;
template class vector<int>;
// valid
using std::vector;
%template(vin) vector<int>;
template class vector<int>;
// ill-formed
namespace unrelated {
using std::vector;
%template(vin) vector<int>;
template class vector<int>;
}
// ill-formed
namespace unrelated {
using namespace std;
%template(vin) vector<int>;
template class vector<int>;
}
// ill-formed
namespace unrelated {
namespace std {
%template(vin) vector<int>;
template class vector<int>;
}
}
// ill-formed
namespace unrelated {
%template(vin) std::vector<int>;
template class std::vector<int>;
}
When the scope is incorrect, an error now occurs such as:
cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
Previously SWIG accepted the ill-formed examples above but this led to
numerous subtle template scope problems especially in the presence of
using declarations and using directives as well as with %feature and %typemap.
Actually, a valid instantiation is one which conforms to the C++03
standard as C++11 made a change to disallow using declarations and
using directives to find a template.
// valid C++03, ill-formed C++11
using std::vector;
template class vector<int>;
Similar fixes for defining classes using forward class references have
also been put in place. For example:
namespace Space1 {
struct A;
}
namespace Space2 {
struct Space1::A {
void x();
}
}
will now error out with:
cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
For templates only, the template parameters are fully resolved when
handling typemaps. Without this, it is too hard to have decent rules
to apply typemaps when parameter types are typedef'd and template
parameters have default values.
Fixes %clear for typedefs in templates, eg:
%typemap("in") XXX<int>::Long "..."
template typename<T> struct XXX {
typedef long Long;
};
%clear XXX<int>::Long;
as the typemap was previously incorrectly stored as a typemap for long
instead of XXX<int>::Long.
* fschlimb-templ_def_cache:
Add template_default_cache runtime tests
Fix template_default_cache testcase
template_default_cache is a multi-module test
using 2-level caching as suggested by @wsfulton
account for explicitly qualified scopes
adding test
restricting chaching template default types
The way Python docstrings are indented has changed on master, so use the
standard inspect module in Python autodoc unit test to ignore the differences
in their indentation level between -builtin and non-builtin cases to make the
test still pass with the branch version, which avoids the use of different
(but almost identical) values in the test itself.
All Swig_name_{construct,copyconstructor,destroy,disown}() functions were
almost exactly identical, just replace them with a single make_full_name_for()
function to avoid code quadplication.
No real changes, but avoid repeating the same snippet of code, looking up
something in a hash and falling back to the default value if it's not present
there, in many places and use a simple wrapper get_naming_format_for()
function instead.
The wrapper function is also marginally more efficient than the old code as it
avoids creating the naming hash just to check if the key is in it -- we can be
pretty sure it isn't, if the hash hadn't existed before.
* char-escaping:
Add missing string_constant.i testcase
changes file update for char wrappers
C# char wrappers fixes for enum values, static const member char values and %csconst
D testing added for %dmanifestconst and char constants
Fix wrapping D constants using %dmanifestconst
Php fix for enum value of '\0'
Fix static const char member variables wrappers with %javaconst(1).
Expand char testing in enums and %constant
Java char changes file update
Java enum and static member variable escaping fix for chars
Add tests for enum values and static const member variables chars containing escape sequences
Minor documentation tweak
Conflicts:
CHANGES.current
The functions Swig_typemap_new_scope() and Swig_typemap_pop_scope() introduced
by 503746e964 back in 2000 were never used and
ended up being commented out themselves, but support for typemap scopes still
remain in several other functions. Remove it completely to make the code
simpler without any ill effects.
Fix for breakages in previous few commits:
- Perl test-suite - the "varout" typemap "type" attribute is now
expanded in typemap.c instead of Perl.cxx.
- The swig_typemap_warn errors testcase showed that $1 was no longer
being expanded correctly when used in output typemaps (lname not set).
Updated Doxygen error numbers yet again, as Python errors got added in the
meanwhile, pushing the Doxygen ones further off.
And re-merged PEP8/whitespace-related conflicts in autodoc_runme.py once again
(if anybody is looking for a motivating example about why significant
whitespace is bad, here is a great use case).
Change Doxygen error codes to start at 740 instead of at 720 as the latter was
taken by Scilab in the meanwhile.
Resolve conflicts in autodoc_runme.py once again.
Test case is slightly modified from the test case in issue #250
Use of constant objects does not seem to work in Python - the type is
SwigPyObject instead of constant_directive.Type1.
Update Doxygen-specific Python unit tests to work with the new indentation.
Update one of Doxygen-specific Java tests to still build with the new handling
of srcdir.
This is just a simple code refactor, moving and function renaming to
remove the %extend code out of the parser into its own file now
that it isn't just used in the parser.
Fixes problem with method overloading when some methods are added by %extend
and others are real methods and using template default parameters with smart pointers.
This is noticeable as a regression since 2.0.12 when using the default smart pointer
handling for some languages when the smart pointer wraps std::map and other STL containers.
Fixes SF Bug 1363
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
* nested:
Deprecation of the 'nestedworkaround' feature
Ensure -c++out is not used with -c++
Add missing header to new source file
Nested C class setters restored in c++out mode for Octave
Classprefix fixed after private nested classes some comments and spaces added
Fix template partial specialization detection
Minor tweaks in Swig_feature_set
Swig_offset_string moved to misc.c
nested private classes are discarded while parsing nested relate functions are moved to nested.cxx and renamed accordingly
out-of-scope template definitions fixed nested_private test disabled again
fixed out-of-scope nested class definitions, added a test enabled nested C structs assignment (still disabled for Octave), added Java runtime test fixed nested_private test case for Java & C#
Testcase of private nested class usage causing segfault
C nested struct passed by value example
Add in Travis testing for nested branch
Add C++ nested class example
Minor code improvements
Cosmetics/code beautification of nested class support
Nested classes support
Error checking for this combination implemented as well as correcting
Octave
Also refactor, replacing CPlusPlusOut variable with cparse_cplusplusout
for an implementation which more closely resembles cparse_cplusplus which
is also required in both .c and .cxx files.
Suitable casts are required so that assignment of instances of nested classes
work as the nested class is duplicated in the global namespace, eg:
struct Outer {
struct Nested {
int bar;
} bar_instance;
};
Outer.bar_instance can now be assigned to.
Closes#89
Squash merge branch 'master' of https://github.com/wkalinin/swig into wkalinin-nested
By Vladimir Kalinin
* 'master' of https://github.com/wkalinin/swig:
CPlusPlusOut mode for Octave
nested class illustration
fixed "Abstract" flag for nested classes added an example enabled anonymous nested structs runtime test
porting
warnings disabled
porting fixes
java runtime tests ported
nested class closing bracket offset fixed
removed double nested template (not supported by %template parsing)
template_nested test extended
parent field made public
property access fixed
replaced tabs with spaces
warning W-reorder
deprecated warnings removed, derived_nested runtime test added
optimized string indenting
Nested classes indenting
nested classes docs
fixed the order in which flattened inner classes are added after the outer
Private nested classes were getting into the type table.
Java getProxyName() fix for nested classes fixes the case when nested classes is forward declared
Fix for a case when a nested class inherits from the same base as the outer. (Base class constructor declaration is found first in this case)
merge fix
nested C struct first immediate declaration incorrectly renamed sample fixed
tests updated to reflect nested classes support
Java nested classes support (1)
flattening should remove the link to the outer class
access mode correctly set/restored for nested classes
nested templates should be skipped while flattening (template nodes themselves, not expanded versions) also non-public nested classes should be ignored
If nested classes are not supported, default behaviour is flattening, not ignoring flag "nested" is preserved, so, the nested classes can be ignored by user
nested workaround test updated
template instantiated within a class is marked as nested for ignoring purposes
%ignore not applied to the nested classed, because "nested" flag is set too late
typedef name takes precedence over the real name (reason?)
unnamed structs should be processed for all the languages
nested C struct instances are wrapped as "immutable"
tree building
typedef declaration for unnamed C structures fixed
nested classes "flattening"
fixed %ignoring nested classes
renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
tree iteration fix
dirclassname variable names unified memory issue fixed
merge error
ignore unnamed structs for C++
unnamed nested C structs naming & unnesting
class added to classes hash under typedef name
private nested classes skipped
test updated due to nested templates support
anonymous structs with inheritance fixed nested_class test to allow anonymous structs w/o declarator
tests updated: nested workaround removed from namespace_class.i propagated nested template declaration to the C++ file
injected members scope
nested tempplates fixes, nested structures in "C" mode parsing added utility function "appendSibling" (like "appendChild")
nested unnamed structures parsing fixes, access mode restored on nested class end, tdname is properly patched with outer class name prefix
memory management fixes
nested templates (1)
Nested unnamed structs
Nested class support (1)
Nested class support (1)
Allow using Perl-like \l, \L, \u, \U and \E escape sequences in the
substitution string used with %rename("%(regex:/pattern/subst/)s").
This is useful for e.g. title casing all string after removing some prefix.
Closes#82
Check if the value being inherited doesn't already exist for the derived
class: if it does, we must not overwrite it.
Fixes regression introduced in r12865.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
We used to modify the hash table that we iterated on in
Swig_name_object_inherit() and this could, and sometimes did, change the
iteration order in such way that not all entries we were looking for could be
found. In practice this means that sometimes the methods renamed or ignored in
the base class could be mysteriously not renamed or ignored in a derived
class.
Fix this by avoiding modifying the hash table in place and using another
temporary hash table instead.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12865 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Skip over %renames with non-matching %(regex)s expansion when looking for the
one to apply to the given name. This allows to have multiple anonymous renames
using regex as now the first _matching_ one will be used instead of always
using the first one and ignoring all the rest of them.
Extend unit tests to verify that applying two anonymous %renames does work as
expected.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12293 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Renames which are regular expressions can't be put in the regex hash as they
don't literally match the real declarations names. Instead, put them in the
rename list against which we will match the declarations names later.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12292 626c5289-ae23-0410-ae9c-e8d60b6d4f22
We didn't handle pcre_exec() return code properly and so the replacement could
be still done even if there was no match if the replacement part contained
anything else than back-references (in this, the only tested so far, case the
replacement was still done but the result turned out to be empty and the
calling code assumed the regex didn't match).
Do check for PCRE_ERROR_NOMATCH now and also give an error message if another
error unexpectedly occurred.
Add a test case for the bug that was fixed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12187 626c5289-ae23-0410-ae9c-e8d60b6d4f22
"regexmatch" and "notregexmatch" can be used with anonymous %renames in the
same way as "match" and "notmatch" while "regextarget" specifies that the
argument of a non-anonymous %rename should be interpreted as a regular
expression.
Document the new functions.
Also add a new unit test for %regex also testing regexmatch &c and provide
test code for C# and Java verifying that it works as intended.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12174 626c5289-ae23-0410-ae9c-e8d60b6d4f22