Major refactoring: translation now takes a node and returns a translated comment if there is one.

This is to allow for situations where you need to use several nodes to create a comment, for example where there are multiple overloads for the same function but the target language doesnt support overloading: in this case we want to combine comments to explain the possible overloads.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10843 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Jamie Kirkpatrick 2008-09-12 11:20:58 +00:00
commit 01695a3128
10 changed files with 324 additions and 201 deletions

View file

@ -1032,6 +1032,17 @@ String *Swig_string_rxspencer(String *s) {
}
#endif
/* ------------------------------------------------------------
* is_generated_overload()
* Check if the function is an automatically generated
* overload created because a method has default parameters.
* ------------------------------------------------------------ */
int Swig_is_generated_overload(Node *n)
{
Node *base_method = Getattr(n, "sym:overloaded");
Node *default_args = Getattr(n, "defaultargs");
return ((base_method != NULL) && (default_args != NULL) && (base_method == default_args));
}
/* -----------------------------------------------------------------------------
* Swig_init()

View file

@ -300,8 +300,9 @@ extern int ParmList_is_compactdefargs(ParmList *p);
extern void Swig_init(void);
extern void Swig_warn(const char *filename, int line, const char *msg);
extern int Swig_value_wrapper_mode(int mode);
extern int Swig_is_generated_overload(Node *n);
#define WARNING(msg) Swig_warn(__FILE__,__LINE__,msg)