Hi Brian,
It's been a while, but I finally got to integrating your patch.
I've been able to figure out what is going on, and can now use the
hideif code directly without copying it. I also have a better idea of
how many lines of code you wrote vs copied from hideif. If you can get
a release to the FSF that would be great.
You can just write to copyright-clerk@.... Tell them you have
contributions to both EMACS and CEDET, and you will be sent the forms by
email which you will need to send back via paper.
Despite all that, I ran all my test suites and they pass, and I've
checked this code into CVS. I can pull it out later if you have issues
getting paper work signed and ready for the FSF.
For all those watching at home, I don't know how the hideif API
stability has been over the past few releases of Emacs/XEmacs. It would
be great if you could test this on various Emacs flavors and let me know
if there are issues. Thanks!
Lastly, there is now a new side-effect feature! If you use
CEDET/Semantic, and HIDEIF, you can set this variable:
(setq semantic-c-takeover-hideif t)
and hideif will now automatically use all the Semantic information for
evaluating what to hide. Nifty! Except that I haven't tested it as I'm
not a hideif user. If you are, try it at let me know how it goes, and
we can add it to the manual as another augmented Emacs feature.
Thanks!
Eric
On 11/25/2009 12:15 PM, Brian J. Carlson wrote:
> "Brian J. Carlson"<gmane.briancarlson@...> [Thu, 19 November 2009 (14:32 EST)] wrote:
>
>>>>
>>>> I have recently started using CEDET with boost and have narrowed down a
>>>> parsing "problem."
>>>>
>>>> The problem is that #ifdef pre-parsing is not evaluating correctly.
>>>>
>>>> An example of this type of statement is as follows:
>>>> #if defined(BOOST_NO_MEMBER_TEMPLATES)&& !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
>>>>
>>
>>> Hi Brian,
>>>
>>> Your assessment is correct. The preprocessor in CEDET for C doesn't
>>> do much for complex expressions.
>
>>> If you'd like to take a crack at this problem in
>>> semantic-c-do-lex-if, I expect that the solution is to change the regex
>>> in semantic-lex-c-if to exclude the expression, and to extract it 'by
>>> hand' in semantic-c-do-lex-if where it could then be evaluated. If you
>>> don't have time, hopefully I can examine this more after Thanksgiving.
>
> Eric,
>
> I did take a quick crack at this. I borrowed from hideif.el and do some
> parsing. It's not perfect (in that it doesn't evaluate C-Macros in an
> #if pre-processor directive among other things), but it does a very
> large number of the things I needed. It's extremely "hackish" and
> probably doesn't follow the paradigm (ooooooh BS Bingo word) you were
> thinking about.
>
> I'd be interested in working with this some more if you'd like.
>
>
>
>
>
>
>>>
>>>
>>> If your patch is over 10 lines long or so, I'll also need a release
>>> so your changes can be included in Emacs.
>
> Ummm it is well over 10 lines, so if you decide to include my changes,
> let me know and I'll fill out the FSF (I'm assuming it's FSF since I
> noticed that CEDET is going into the next emacs YEAH!!!) paperwork for
> your changes.
>
>> Of course I also noticed that the following is also not quite right, but this
>> is a result of my looking at the first problem and is not really that much of a
>> problem for me right now:
>>
>> #define A
>> #define B
>> #if defined(A)
>> void a();
>> #elif defined(B)
>> void b();
>> #else
>> void c();
>> #endif
>
> My changes still doesn't address this, but this was a very tricky piece,
> to evaluate the first #if then know to skip over all the next
> #elif statement. (i.e. difficult to know whether the first #if was
> evaluated as true and the #elif at (point) was to be tested or not.
> At least in the very short term.
>
>
> Thanks,
>
> ;-Brian J. Carlson
> Leominster, MA
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>
>
>
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
|