Re: Semantic parses function with default argument incorrectly
Eric Ludlam <[email protected]> Wed, 31 Aug 2016 21:22:40 -0400
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've experimented with your patch, and agree that this looks like the right solution to me. I also added a test that this will both parse, and then the tag will format itself correctly. Were there any completion related examples you might have I could add for additional test coverage? Thanks Eric On 08/30/2016 06:11 PM, Bastian Beischer wrote: > I think I may have found the solution, but it would be great if > someone could check this patch: > > diff --git a/lisp/cedet/semantic/bovine/c.by b/lisp/cedet/semantic/bovine/c.by > index 80ed2cf..6c4cea4 100644 > --- a/lisp/cedet/semantic/bovine/c.by > +++ b/lisp/cedet/semantic/bovine/c.by > @@ -1250,7 +1250,7 @@ unaryexpression > | multi-stage-dereference > | NEW multi-stage-dereference > | NEW builtintype-types semantic-list > - | symbol > + | namespace-symbol > ;; Klaus Berndl: C/C++ allows sequences of strings which are > ;; concatenated by the precompiler to one string > | string-seq > > On Tue, Aug 30, 2016 at 11:40 PM, Bastian Beischer > <[email protected]> wrote: >> The following piece of code is not correctly parsed by semantic: >> >> namespace NS { >> enum TestEnum {a,b}; >> } >> >> void f(NS::TestEnum v = NS::a); >> >> This is with the current master branch of http://git.code.sf.net/p/cedet/git. >> >> The issue is that after parsing the buffer 'semantic-describe-tag' on >> the function 'f' reports: >> >> Functions: void f (NS::TestEnum v[=NS],a) >> >> "a" is interpreted as a second argument which is not correct. The >> version of semantic included in Emacs 25.1 RC 2 does not show this >> behavior. Instead it reports: >> >> Functions: void f (NS::TestEnum v[=NS]) >> >> which is also not correct, it should report the default value as NS::a. >> >> I think the grammar needs tweaking? Any help on how to fix this? >> >> Cheers >> Bastian >> >> -- >> Bastian Beischer >> RWTH Aachen University of Technology >> >> @RWTH Aachen >> Office: 28 C 203 >> Phone: +49-241-80-27205 >> E-mail: [email protected] >> Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen >> >> @CERN >> Office: Bdg 32-4-B12 >> Phone: +41-22-76-75750 >> E-mail: [email protected] >> Address: CERN, CH-1211 Geneve 23 > > > ------------------------------------------------------------------------------