Re: [PATCH] v2 Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-12 Thread Bernhard Reutner-Fischer
On December 9, 2015 2:07:05 AM GMT+01:00, David Malcolm 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

Re: [PATCH] v2 Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-10 Thread Tobias Burnus
David Malcolm wrote: > On Sat, 2015-12-05 at 20:53 +0100, Mikael Morin wrote: > > to get things moving again, a few comments on top of David Malcolm's: [...] > > It seems you are considering some candidates more than once here. [...] > > You have to start the lookup with the current namespace's sym

[PATCH] v2 Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-08 Thread David Malcolm
dy throughout the frontend; Use CLASS_DATA here for brevity. */ > > + lookup_component_fuzzy_find_candidates (CLASS_DATA (p), candidates); > I don't understand what you are looking for here. > Are you trying to handle type extension? Then I guess you would have to > pass the

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-05 Thread Mikael Morin
Hello, to get things moving again, a few comments on top of David Malcolm's: Le 01/12/2015 13:55, Bernhard Reutner-Fischer a écrit : David Malcolm nice Levenshtein distance spelling check helpers were used in some parts of other frontends. This proposed patch adds some spelling corrections to

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-03 Thread Steve Kargl
On Thu, Dec 03, 2015 at 02:53:06PM +0100, Mikael Morin wrote: > Le 03/12/2015 10:29, Janne Blomqvist a écrit : > > On Tue, Dec 1, 2015 at 7:51 PM, Bernhard Reutner-Fischer > > wrote: > >> As said, we could as well use a list of candidates with NULL as record > >> marker. > >> Implementation cosme

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-03 Thread Mikael Morin
Le 03/12/2015 10:29, Janne Blomqvist a écrit : On Tue, Dec 1, 2015 at 7:51 PM, Bernhard Reutner-Fischer wrote: As said, we could as well use a list of candidates with NULL as record marker. Implementation cosmetics. Steve seems to not be thrilled by the overall idea in the first place, so unles

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-03 Thread Janne Blomqvist
On Tue, Dec 1, 2015 at 7:51 PM, Bernhard Reutner-Fischer wrote: > As said, we could as well use a list of candidates with NULL as record marker. > Implementation cosmetics. Steve seems to not be thrilled by the > overall idea in the first place, so unless there is clear support by > somebody else

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Steve Kargl
On Tue, Dec 01, 2015 at 12:58:28PM -0500, David Malcolm wrote: > On Tue, 2015-12-01 at 18:51 +0100, Bernhard Reutner-Fischer wrote: > > As said, we could as well use a list of candidates with NULL as record > > marker. > > Implementation cosmetics. Steve seems to not be thrilled by the > > overall

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Steve Kargl
On Tue, Dec 01, 2015 at 06:34:57PM +0100, Bernhard Reutner-Fischer wrote: > On 1 December 2015 at 17:41, Steve Kargl > > > > Yes, I know there are other C++ (mis)features within the > > Fortran FE especially in the trans-*.c files. Those are > > accepted (by some) as necessary evils to interface w

RE: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread VandeVondele Joost
So, I have tested the patch, it seems to work well. I would really like to see this feature in the compiler, I'm sure it will help people developing Fortran code. I have already an enhancement request, catching the name of 'Keyword argument' : > cat test.f90 MODULE test CONTAINS SUBROUTINE fo

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread David Malcolm
On Tue, 2015-12-01 at 18:51 +0100, Bernhard Reutner-Fischer wrote: > On 1 December 2015 at 18:28, David Malcolm wrote: > > On Tue, 2015-12-01 at 13:55 +0100, Bernhard Reutner-Fischer wrote: > > > >> +/* Lookup function FN fuzzily, taking names in FUN into account. */ > >> + > >> +const char* >

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Bernhard Reutner-Fischer
On 1 December 2015 at 18:28, David Malcolm wrote: > On Tue, 2015-12-01 at 13:55 +0100, Bernhard Reutner-Fischer wrote: >> +/* Lookup function FN fuzzily, taking names in FUN into account. */ >> + >> +const char* >> +gfc_lookup_function_fuzzy (const char *fn, gfc_symtree *fun) >> +{ >> + auto_v

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Bernhard Reutner-Fischer
On 1 December 2015 at 17:41, Steve Kargl wrote: > On Tue, Dec 01, 2015 at 05:12:57PM +0100, Bernhard Reutner-Fischer wrote: >> On 1 December 2015 at 16:01, Steve Kargl >> wrote: >> > On Tue, Dec 01, 2015 at 01:55:01PM +0100, Bernhard Reutner-Fischer wrote: >> >> >> >> David Malcolm nice Levenshte

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread David Malcolm
On Tue, 2015-12-01 at 13:55 +0100, Bernhard Reutner-Fischer wrote: > gcc/fortran/ChangeLog > > 2015-11-29 Bernhard Reutner-Fischer > > * gfortran.h (gfc_lookup_function_fuzzy): New declaration. > * resolve.c: Include spellcheck.h. > (lookup_function_fuzzy_find_candidates): Ne

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Steve Kargl
On Tue, Dec 01, 2015 at 05:12:57PM +0100, Bernhard Reutner-Fischer wrote: > On 1 December 2015 at 16:01, Steve Kargl > wrote: > > On Tue, Dec 01, 2015 at 01:55:01PM +0100, Bernhard Reutner-Fischer wrote: > >> > >> David Malcolm nice Levenshtein distance spelling check helpers > >> were used in som

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Bernhard Reutner-Fischer
On 1 December 2015 at 16:01, Steve Kargl wrote: > On Tue, Dec 01, 2015 at 01:55:01PM +0100, Bernhard Reutner-Fischer wrote: >> >> David Malcolm nice Levenshtein distance spelling check helpers >> were used in some parts of other frontends. This proposed patch adds >> some spelling corrections to t

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread VandeVondele Joost
Today, I ran 'gfortran -static-libfortran test.f90' and was very pleased with the answer: gfortran: error: unrecognized command line option ‘-static-libfortran’; did you mean ‘-static-libgfortran’? So thanks David, and hopefully we get this user experience for the FE as well. Joost

Re: [PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Steve Kargl
On Tue, Dec 01, 2015 at 01:55:01PM +0100, Bernhard Reutner-Fischer wrote: > > David Malcolm nice Levenshtein distance spelling check helpers > were used in some parts of other frontends. This proposed patch adds > some spelling corrections to the fortran frontend. > > Suggestions are printed if w

[PATCH] RFC: Use Levenshtein spelling suggestions in Fortran FE

2015-12-01 Thread Bernhard Reutner-Fischer
gcc/fortran/ChangeLog 2015-11-29 Bernhard Reutner-Fischer * gfortran.h (gfc_lookup_function_fuzzy): New declaration. * resolve.c: Include spellcheck.h. (lookup_function_fuzzy_find_candidates): New static function. (lookup_uop_fuzzy_find_candidates): Likewise.