Review Request 115299: Add support for trait uses to kdev-php

Milian Wolff mail at milianw.de
Mon Feb 3 20:47:11 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115299/#review48865
-----------------------------------------------------------



duchain/builders/declarationbuilder.cpp
<https://git.reviewboard.kde.org/r/115299/#comment34504>

    this must be called while holding the lock.
    
    Generally, I suggest putting even more into a separate helper function such that you can do:
    
    {
      DUChainWriteLocker lock;
      foo = ...;
      if (foo) {
        callHelper();
      }
    }
    Base::visit...();



duchain/builders/declarationbuilder.cpp
<https://git.reviewboard.kde.org/r/115299/#comment34505>

    there's still the wlock from above so this is not required, is it?



duchain/builders/usebuilder.cpp
<https://git.reviewboard.kde.org/r/115299/#comment34506>

    again, same problem with the lock - its still held while you call this and recurse. 


- Milian Wolff


On Feb. 3, 2014, 6:19 p.m., Heinz Wiesinger wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115299/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2014, 6:19 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Bugs: 305779
>     http://bugs.kde.org/show_bug.cgi?id=305779
> 
> 
> Repository: kdev-php
> 
> 
> Description
> -------
> 
> Add support for trait uses, as introduced in PHP 5.4.
> This can be syntax as simple as
> 
> class A {
>   use B;
> }
> 
> or as complicated as
> 
> class A {
>   use B,C,D {
>     B::one insteadof C,D;
>     C::two as foo;
>     D::three as protected bar;
>   }
> }
> 
> allowing changing both function name and visibility. Additionally this syntax allows manual conflict resolution.
> 
> The error messages I used are as close as possible to the actual errors given by PHP. We check for
> - invalid function modifiers (static, final)
> - property name conflicts between traits and main class
> - method name conflicts between multiple traits
> 
> 
> Diffs
> -----
> 
>   duchain/tests/expressionparser.h 0e59aab68c2d8a9c9b8cee84d237f921c29a5c9f 
>   duchain/tests/expressionparser.cpp cb0045ca733cd3b382aeddf574520307a2144e80 
>   duchain/tests/uses.h b97f15b8bfed391b236e92aee3a4efa9d589d451 
>   duchain/tests/uses.cpp 8ae049c1a5a96db9ed03eeed24a01e86dbb88ac3 
>   parser/php.g 9271989f5ea83dd5974ad5962b75b974edd0212a 
>   parser/phplexer.cpp 3a0a57dac6e7ebbe3e2c7d59912dc289bc25f71f 
>   completion/context.cpp e7d4335adc2157c3ffa2b4aad23613837f675d61 
>   duchain/builders/declarationbuilder.h 826bbb5d87cc3408c326cdf34191405907a6e1bf 
>   duchain/builders/declarationbuilder.cpp 0d45d86e1d992cf0d5aeea7264797c5d91e59f5f 
>   duchain/builders/usebuilder.h af10294ea72d6b9ac156e7ca31745d17a5c4c1db 
>   duchain/builders/usebuilder.cpp 32c2490efe19958d9d9b4ae93796fc6e2fdaf42c 
>   duchain/navigation/declarationnavigationcontext.h 5ea31346522b2f24f1864b2876da6a3b9ddecba8 
>   duchain/navigation/declarationnavigationcontext.cpp 08d01425a0a94b3a65774141476783f9ce3a304c 
> 
> Diff: https://git.reviewboard.kde.org/r/115299/diff/
> 
> 
> Testing
> -------
> 
> Unit tests, parsing local test files
> 
> 
> Thanks,
> 
> Heinz Wiesinger
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140203/10728855/attachment-0001.html>


More information about the KDevelop-devel mailing list