On Mon, 2020-06-01 at 14:11 -0600, Tom Tromey wrote:
> > Did the full DejaGnu testsuite get run?  There are a lot of tests
> > in it
> > that make use of this code.
> 
> I did "make check" and only saw some XFAILs.
> 
> Here's v2 of the patch, which I think addresses your comments.  I did
> not add a new test of get_edit_distance, because as I mentioned
> earlier,
> an existing test already does what you asked for.
> 
> Tom
> 
> commit e897a99dada8d3935343ebf7b14ad7ec36515b3d
> Author: Tom Tromey <tro...@adacore.com>
> Date:   Fri May 29 10:46:57 2020 -0600
> 
>     Prefer simple case changes in spelling suggestions
>     
>     I got this error message when editing gcc and recompiling:
>     
>     ../../gcc/gcc/ada/gcc-interface/decl.c:7714:39: error:
> ‘DWARF_GNAT_ENCODINGS_all’ was not declared in this scope; did you
> mean ‘DWARF_GNAT_ENCODINGS_GDB’?
>      7714 |     = debug_info && gnat_encodings ==
> DWARF_GNAT_ENCODINGS_all;
>           |                                       ^~~~~~~~~~~~~~~~~~~
> ~~~~~
>           |                                       DWARF_GNAT_ENCODING
> S_GDB
>     
>     This suggestion could be improved -- what happened here is that I
>     failed to upper-case the word, and DWARF_GNAT_ENCODINGS_ALL was
> the
>     correct spelling.
>     
>     This patch changes gcc's spell checker to prefer simple case
> changes
>     when possible.
>     
>     I tested this using the self-tests.  A new self-test is also
> included.
>     
>     gcc/ChangeLog:
>     
>             * spellcheck.c (CASE_COST): New define.
>             (BASE_COST): New define.
>             (get_edit_distance): Recognize case changes.
>             (get_edit_distance_cutoff): Update.
>             (test_edit_distances): Update.
>             (get_old_cutoff): Update.
>             (test_find_closest_string): Add case sensitivity test.

Thanks; looks good to me.

Dave
 


Reply via email to