Review Request 117612: Make ExpressionVisitor inherit from DynamicLanguageExpressionVisitor

Denis Steckelmacher steckdenis at yahoo.fr
Thu Apr 17 16:49:03 UTC 2014



> On April 17, 2014, 3:46 p.m., Sven Brauch wrote:
> > duchain/expressionvisitor.h, line 58
> > <https://git.reviewboard.kde.org/r/117612/diff/1/?file=266525#file266525line58>
> >
> >     What's this for? Sorry, I'm C++ illiterate and I don't know what it does in this context. Will the function be hidden otherwise?

It's a bit tricky. If I don't put this line, then the C++ compiler sees that I redefine encounter() two lines below, and it completely hides DynamicLanguageExpressionVisitor::encounter . With this line, I tell the C++ compiler that, even if I redefine two versions of encounter, I still want the version of DynamicLanguageExpressionVisitor to be visible.


- Denis


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


On April 17, 2014, 12:16 p.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117612/
> -----------------------------------------------------------
> 
> (Updated April 17, 2014, 12:16 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> Sven Brauch has just added a DynamicLanguageExpressionVisitor class in KDevPlatform. This class contains several useful methods for dynamic language expression visitors, such as everything needed to keep track of the current type and current declaration, and also a method that can be used to build a mixed integral type (very nice addition!)
> 
> This patch makes ExpressionVisitor inherit from DynamicLanguageExpressionVisitor. The patch is fairly simple as it removes one setType() method and changes every use of setType to encounter(). I also had to change QmlJS::findDeclaration, as it took a DUContextPointer parameter. The problem was that the constructor of DUContextPointer requires a DUContext*, while DynamicLanguageExpressionVisitor only provides a const DUContext*.
> 
> 
> Diffs
> -----
> 
>   duchain/expressionvisitor.h bd82ff2 
>   duchain/expressionvisitor.cpp a7e0ba6 
>   duchain/helper.h 23a6d0e 
>   duchain/helper.cpp 935ccd8 
>   duchain/usebuilder.cpp 154a4d3 
> 
> Diff: https://git.reviewboard.kde.org/r/117612/diff/
> 
> 
> Testing
> -------
> 
> All the existing unit tests pass with the simplified expression visitor.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140417/7c47d16f/attachment.html>


More information about the KDevelop-devel mailing list