|
Boost-Commit : |
From: nickm_at_[hidden]
Date: 2007-09-18 13:28:23
Author: nikiml
Date: 2007-09-18 13:28:23 EDT (Tue, 18 Sep 2007)
New Revision: 39370
URL: http://svn.boost.org/trac/boost/changeset/39370
Log:
tabs removes, code reformatting
Text files modified:
trunk/libs/python/src/object/function.cpp | 2
trunk/libs/python/src/object/function_doc_signature.cpp | 69 ++++++++++++++++++++++-----------------
2 files changed, 40 insertions(+), 31 deletions(-)
Modified: trunk/libs/python/src/object/function.cpp
==============================================================================
--- trunk/libs/python/src/object/function.cpp (original)
+++ trunk/libs/python/src/object/function.cpp 2007-09-18 13:28:23 EDT (Tue, 18 Sep 2007)
@@ -628,7 +628,7 @@
{
function* f = downcast<function>(op);
list signatures = function_doc_signature_generator::function_doc_signatures(f);
- if(!signatures) return python::detail::none();
+ if(!signatures) return python::detail::none();
signatures.reverse();
return python::incref( str("\n").join(signatures).ptr());
}
Modified: trunk/libs/python/src/object/function_doc_signature.cpp
==============================================================================
--- trunk/libs/python/src/object/function_doc_signature.cpp (original)
+++ trunk/libs/python/src/object/function_doc_signature.cpp 2007-09-18 13:28:23 EDT (Tue, 18 Sep 2007)
@@ -278,45 +278,53 @@
for (fi=funcs.begin(); fi!=funcs.end(); ++fi)
{
if(*sfi == *fi){
- if((*fi)->doc()){
+ if((*fi)->doc())
+ {
str func_doc = str((*fi)->doc());
+
int doc_len = len(func_doc);
- bool show_py_signature = doc_len >=int(sizeof(detail::py_signature_tag)/sizeof(char)-1)
- && str(detail::py_signature_tag)==func_doc.slice(0, int(sizeof(detail::py_signature_tag)/sizeof(char))-1);
- if(show_py_signature){
- func_doc = str(func_doc.slice(int(sizeof(detail::py_signature_tag)/sizeof(char))-1, _));
- doc_len = len(func_doc);
- }
-
- bool show_cpp_signature = doc_len >=int(sizeof(detail::cpp_signature_tag)/sizeof(char)-1)
- && str(detail::cpp_signature_tag)==func_doc.slice(- int(sizeof(detail::cpp_signature_tag)/sizeof(char))+1, _);
-
- if(show_cpp_signature){
- func_doc = str(func_doc.slice(_, 1 - int(sizeof(detail::cpp_signature_tag)/sizeof(char))));
- doc_len = len(func_doc);
- }
-
+
+ bool show_py_signature = doc_len >= int(sizeof(detail::py_signature_tag)/sizeof(char)-1)
+ && str(detail::py_signature_tag) == func_doc.slice(0, int(sizeof(detail::py_signature_tag)/sizeof(char))-1);
+ if(show_py_signature)
+ {
+ func_doc = str(func_doc.slice(int(sizeof(detail::py_signature_tag)/sizeof(char))-1, _));
+ doc_len = len(func_doc);
+ }
+
+ bool show_cpp_signature = doc_len >= int(sizeof(detail::cpp_signature_tag)/sizeof(char)-1)
+ && str(detail::cpp_signature_tag) == func_doc.slice( 1-int(sizeof(detail::cpp_signature_tag)/sizeof(char)), _);
+
+ if(show_cpp_signature)
+ {
+ func_doc = str(func_doc.slice(_, 1-int(sizeof(detail::cpp_signature_tag)/sizeof(char))));
+ doc_len = len(func_doc);
+ }
+
str res="\n";
- str pad = "\n";
+ str pad = "\n";
+
if(show_py_signature)
{
str sig = pretty_signature(*fi, n_overloads,false);
res+=sig;
- if(doc_len || show_cpp_signature )res+=" :";
- pad+= str(" ");
+ if(doc_len || show_cpp_signature )res+=" :";
+ pad+= str(" ");
+ }
+
+ if(doc_len)
+ {
+ if(show_py_signature)
+ res+=pad;
+ res+= pad.join(func_doc.split("\n"));
}
-
- if(doc_len){
- if(show_py_signature)
- res+=pad;
- res+= pad.join(func_doc.split("\n"));
- }
-
- if( show_cpp_signature){
- if(len(res)>1)
- res+="\n"+pad;
+
+ if( show_cpp_signature)
+ {
+ if(len(res)>1)
+ res+="\n"+pad;
res+=detail::cpp_signature_tag+pad+" "+pretty_signature(*fi, n_overloads,true);
- }
+ }
signatures.append(res);
}
@@ -325,6 +333,7 @@
}else
++n_overloads ;
}
+
return signatures;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk