<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/102432/">http://git.reviewboard.kde.org/r/102432/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On September 2nd, 2011, 10:01 a.m., <b>David Nolden</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This should not be added to the standard KDevelop::Declaration class, because an additional appended-list is a quite heavy addition.
In general, every decorator simply describes some attribute, like for example "virtual" in C++, no? So the question is, why do you want to abstract them away into decorator-list, instead of for example creating a "PythonDeclaration" which has a "bool isAbstractMethod()"? (of course only for the decorators/attributes which are interesting to you)</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Okay, I see your point.
No, decorators are not like attribute keywords, because there's no fixed set of decorators. It's only a syntax for calling a function, if you want to put it like that. Many frameworks (like SQLAlchemy, Django, ...) introduce decorators to modify methods and classes, and it would be useful to track that. As the set of decorators can change at any time (you can even define your own ones) this can not be solved by adding some enum flags to a declaration. See my previous post for a simple custom example.

If I want to put this into python only, I'll need to subclass Declaration and add an appended list to it. However, Declaration already defines appended lists. What's the syntax for adding another one? I couldn't find any example for that, and I didn't manage to do it by myself, either.

Thanks,
Sven</pre>
<br />








<p>- Sven</p>


<br />
<p>On August 25th, 2011, 1:22 p.m., Sven Brauch wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Sven Brauch.</div>


<p style="color: grey;"><i>Updated Aug. 25, 2011, 1:22 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This adds a list of Decorators to each class and function declaration, and a Decorator class which stores information about those decorators.
This is currently relevant for the python language, which has a pattern like this:

class c():
    @staticmethod
    def foo():
        pass

I didn't have an internet connection for research available, but I think other languages might have similar patterns, so this can go into kdevplatform.
Also, even after several hours of experimentation I couldn't figure out how to inherit from a class which defines appended lists, adding another one... some documentation on that would be appreciated :)</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>language/CMakeLists.txt <span style="color: grey">(4399ebb)</span></li>

 <li>language/duchain/classdeclaration.h <span style="color: grey">(409a3a4)</span></li>

 <li>language/duchain/classdeclaration.cpp <span style="color: grey">(0670209)</span></li>

 <li>language/duchain/decorator.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>language/duchain/functiondeclaration.h <span style="color: grey">(7f084a9)</span></li>

 <li>language/duchain/functiondeclaration.cpp <span style="color: grey">(fb442dc)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/102432/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>