Re: [cedet-semantic] Enums
Brought to you by:
zappo
From: Eric M. L. <eri...@gm...> - 2012-01-16 21:23:11
|
On 01/16/2012 08:03 AM, di...@gm... wrote: > Hi, > > it seems that semantic isn't handling enums properly. > Executing semantic-ia-fast-jump while pointing > GPU_COMPOSITION in foo() doesn't work for me. > > > enum { > GPU_COMPOSITION, > C2D_COMPOSITION, > MDP_COMPOSITION, > CPU_COMPOSITION, > }; > > void foo() > { > int i = GPU_COMPOSITION; > } > In this case, I think the rule where enums appear in the global namespace isn't currently handled. I noticed that if I called the enum FOO, and added FOO:: in front of the enum, things worked fine. (ie - I just had to give it a name.) At a wild guess, we might be able to use the C++ override of semantic-ctxt-scoped-types to pull these entries into the global namespace, as with anonymous namespace entries. If someone on the list would like to take a crack at it, let me know. > BTW, Can semantic highlight syntax errors? As far as I can see semantic is able to reparse to buffer incrementally. semantic-show-unmatched-syntax-mode does that, but the C/C++ parser only parses the the outer context, and skips over the bodies of functions, so it probably won't do what you expect. It would be nice to someday update the parser to the newer parsing system, which would allow us to make the unmatched syntax mode much more useful. Eric |