This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] v2 Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: David Malcolm <dmalcolm at redhat dot com>,Mikael Morin <mikael dot morin at sfr dot fr>
- Cc: fortran at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Dec 2015 18:02:44 +0100
- Subject: Re: [PATCH] v2 Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE
- Authentication-results: sourceware.org; auth=none
- References: <1448974501-30981-1-git-send-email-rep dot dot dot nop at gmail dot com> <1448974501-30981-4-git-send-email-rep dot dot dot nop at gmail dot com> <566340AC dot 3050408 at sfr dot fr> <1449623225 dot 8490 dot 98 dot camel at surprise>
On December 9, 2015 2:07:05 AM GMT+01:00, David Malcolm <dmalcolm@redhat.com> wrote:
>I can't comment on Mikael's observations, but here's an updated version
>of Bernhard's patch which moves the duplicated code into a new
>"find_closest_string" function in gcc/spellcheck.c.
>With that, the lookup_*_fuzzy functions are all of the form:
>
>{
> auto_vec <const char *> candidates;
>
> /* call something to populate candidates e.g.: */
> lookup_function_fuzzy_find_candidates (fun, &candidates);
>
> return find_closest_string (fn, &candidates);
>}
>
>where, as before, the auto_vec is implicitly cleaned up via a
>C++ destructor as the function exits. Hopefully with this change it
>reduces the amount of proposed C++ in the fortran subdirectory to an
>palatable amount.
>
>That's all I did; I didn't address the other issues seen in this thread
>(e.g. Mikael's notes above).
>
>Not yet well-tested; it compiles and passes the new test cases; I'm
>posting it here in case someone more familiar with the Fortran FE wants
>to take this forward (Bernhard?)
I have rewritten the autovec to plain c, will send an updated patch including current comments and maybe the parameter handling as suggested by Joost when done.
Thanks,
>
>Hope this is constructive
>Dave