Re: patch proposal to support multiple c++ namespace opening with a single brace
Shigio YAMAGUCHI <[email protected]> Fri, 14 Apr 2023 19:55:49 +0900
| Newsgroups | gmane.comp.gnu.global.bugs |
|---|---|
| Message-ID | <CADJmJYo+Lru2z29TDMn6j_tWZ33jc1WcAbNPMD1mU0nVGY-K-Q@mail.gmail.com> |
Hello, I accept your patch. It will be included in the next release. Thank you! Regards, Shigio On Fri, Apr 14, 2023 at 4:24 PM Sam <[email protected]> wrote: > > global seems not to support c++ namespace syntax like this : > > namespace name1::name2::name3 { /*...*/ } > > here is a patch that allow global to parse this : > > ---------------------------------------------------------------------------------------------------------------- > diff -ur global-6.6.9/libparser/Cpp.c global-6.6.9-patched/libparser/Cpp.c > --- global-6.6.9/libparser/Cpp.c 2022-12-11 23:38:21.000000000 +0800 > +++ global-6.6.9-patched/libparser/Cpp.c 2023-04-14 14:06:49.421958357 +0800 > @@ -169,13 +169,20 @@ > /* > * namespace name = ...; > * namespace [name] { ... } > + * namespace name[::name]* { ... } > */ > + cpp_namespace_loop: > if ((c = nexttoken(interested, cpp_reserved_word)) == SYMBOL) { > + cpp_namespace_token_loop: > PUT(PARSER_DEF, token, lineno, sp); > if ((c = nexttoken(interested, cpp_reserved_word)) == '=') { > crflag = 1; > break; > } > + if (c == CPP_WCOLON) > + goto cpp_namespace_loop; > + if (c == SYMBOL) > + goto cpp_namespace_token_loop; > } > /* > * Namespace block doesn't have any influence on level. > ---------------------------------------------------------------------------------------------------------------- > > > -- Shigio YAMAGUCHI <[email protected]> PGP fingerprint: 26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB