Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-17 Thread Manuel López-Ibáñez
On 17 September 2015 at 21:57, David Malcolm wrote: > In my mind it's more about saving the user from having to locate the > field they really meant within the corresponding structure declaration > (either by grep, or by some cross-referencing tool). I think it is more than that. After a long cod

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-17 Thread David Malcolm
On Thu, 2015-09-17 at 13:31 -0600, Jeff Law wrote: > On 09/16/2015 02:34 AM, Richard Biener wrote: > > > > Btw, this looks quite expensive - I'm sure we want to limit the effort > > here a bit. > A limiter is reasonable, though as it's been pointed out this only fires > during error processing, so

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-17 Thread Jeff Law
On 09/16/2015 02:34 AM, Richard Biener wrote: Btw, this looks quite expensive - I'm sure we want to limit the effort here a bit. A limiter is reasonable, though as it's been pointed out this only fires during error processing, so we probably have more leeway to take time and see if we can do b

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-17 Thread Richard Biener
On Wed, Sep 16, 2015 at 5:45 PM, Manuel López-Ibáñez wrote: > On 16 September 2015 at 15:33, Richard Biener > wrote: >> On Wed, Sep 16, 2015 at 3:22 PM, Michael Matz wrote: if we suggest 'foo' instead of foz then we'll get a more confusing followup error if we actually use it. >>> >>>

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-16 Thread Manuel López-Ibáñez
On 16 September 2015 at 15:33, Richard Biener wrote: > On Wed, Sep 16, 2015 at 3:22 PM, Michael Matz wrote: >>> if we suggest 'foo' instead of foz then we'll get a more confusing followup >>> error if we actually use it. >> >> This particular case could be solved by ruling out candidaten of the w

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-16 Thread Richard Biener
On Wed, Sep 16, 2015 at 3:22 PM, Michael Matz wrote: > Hi, > > On Wed, 16 Sep 2015, Richard Biener wrote: > >> Btw, this looks quite expensive - I'm sure we want to limit the effort >> here a bit. > > I'm not so sure. It's only used for printing an error, so walking all > available decls is expen

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-16 Thread Michael Matz
Hi, On Wed, 16 Sep 2015, Richard Biener wrote: > Btw, this looks quite expensive - I'm sure we want to limit the effort > here a bit. I'm not so sure. It's only used for printing an error, so walking all available decls is expensive but IMHO not too much so. > I don't want us to suggest using

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-16 Thread Richard Biener
On Tue, Sep 15, 2015 at 5:38 PM, David Malcolm wrote: > Updated patch attached, which is now independent of the rest of the > patch kit; see below. Various other comments inline. > > On Fri, 2015-09-11 at 17:30 +0200, Manuel López-Ibáñez wrote: > On 10/09/15 22:28, David Malcolm wrote: >> > There

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-15 Thread Manuel López-Ibáñez
On 15 September 2015 at 17:38, David Malcolm wrote: > It would be appropriate to exit as soon as we reach 1 if we agree > that lookup_name_fuzzy isn't intended to find exact matches (since > otherwise we might fail to return an exact match if we see a > distance 1 match first). > > I haven't imple