Commit Graph

15 Commits

Author SHA1 Message Date
Vadim Zeitlin f57b096c92 Fix generated Python code for Doxygen comments with triple quotes
In addition to the changes in the previous commit, also avoid syntax
errors in the generated Python docstrings by splitting them into several
parts if there are 3 quotes in a row in the input, as it's impossible to
have them inside triple-quoted strings, generally speaking (i.e. if
there are occurrences of both """ and ''' inside the string).
2020-03-04 00:57:31 +01:00
Vadim Zeitlin b81cd1bdab Fix generated Python code for Doxygen comments ending with quote
Single-line Doxygen comments ending with a double quote resulted in
syntactically-invalid Python docstrings in the output, so use triple
single quotes as delimiters in this case to avoid it.
2020-03-04 00:56:27 +01:00
Vadim Zeitlin 66a7826192 Rewrite Doxygen unit tests for Java using Java 9 API
In particular, do not use com.sun.javadoc deprecated since Java 9 and
finally removed in Java 13, to allow the tests to run under modern JRE.

They don't run under Java 8 and earlier any more, but this shouldn't be
a huge problem nowadays and as SWIG output is independent from the Java
version used, it's enough to test it with modern Java versions.

Note that the tests themselves were changed only in the most minimal
way, to adapt them to the new way of running javadoc (which is now also
integrated into CommentParser itself instead of being duplicated in
every test).
2019-12-18 02:45:06 +01:00
Vadim Zeitlin 01a2cd27e7 Don't crash if type is not available in Python Doxygen code
Fix crash if "@return" Doxygen tag was used on a node without any return
type (such as a class, for example). Ignoring it might not be the best
thing to do, but it's definitely better than crashing and it's not
really clear what else could be done anyhow.

Closes #1516.
2019-04-20 13:52:05 +02:00
luz.paz ed28e7cbe2 Misc. typo and whitespace fixes
Found via `codespell -q 3 -L "uint,bae,objext,cmo,goin,struc,ois,upto"`
whitespaces were unintentionally fixed due to my editors settings.

Rebased patch #1327
2018-09-19 20:29:14 +01:00
Vadim Zeitlin 14ba3b8dd4 Preserve relative indentation when parsing Doxygen comments.
This is important to preserve the structure of the lists which appear
correctly in Python output without any additional effort if the indentation is
lost.

It is also makes the behaviour consistent for

	/**
	 *
	 *
	 */

comments and those without the asterisks in the middle lines, as now the
indentation is preserved in both cases while it was only preserved when the
asterisks were present previously.
2014-08-22 17:45:22 +02:00
Marko Klopcic b5dea7456b improved handling of word commands if puntuation is following the word, preserved spaces at start of comment line 2013-02-21 09:05:11 +01:00
Marko Klopcic 2a8b20785e fixed bug in handling of HTML tags, test added 2013-02-19 07:25:13 +01:00
Marko Klopcic 0d66568ba3 minor refactoring of CommentParser.java 2013-01-29 08:39:35 +01:00
Marko Klopcic 2896938879 only whitespace cnhanges and code comment update 2013-01-29 08:13:03 +01:00
Marko Klopcic a2a345be39 improved handling of @see tags - SWIG no longer crashes if right brace is missing 2013-01-28 22:25:40 +01:00
Marko Klopcic 8de06366cf fixed handling of quoted text adn standalone backslash and @ 2013-01-23 23:15:36 +01:00
Marko Klopcic 8d61aae0fb fixed handling of /******/ comments, added tests for backslash handling, which fail
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13733 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-06 20:56:19 +00:00
Marko Klopcic e62580acb8 fixed doxy documentation (also shortened lines), added test for discovered bug reltaed to nested enums
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13728 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-28 20:59:32 +00:00
Marko Klopcic af74b4f96a renamed test case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13726 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-27 20:25:00 +00:00