On Fri, Oct 31, 2014 at 11:19 AM, David Blaikie <[email protected]> wrote:
> > > On Fri, Oct 31, 2014 at 11:17 AM, David Blaikie <[email protected]> > wrote: > >> Again reminds me that maybe an iterator idiom for typo corrections might >> be nice >> >> (then peaking would be "std::next(i)->...") >> > > But that's up to you when/how you want to address that - given the current > design, this looks plausible. > > If there's a nice way to implement this function without having to change > the object's internal state and then change it back, that'd be great (can > the guts of getNextCorrection be factored in such a way as you could call > "nextCorrectionIndex" as a non-mutating operation, then just use that to > lookup the ValidatedCorrections array? Then the original getNextCorrection > function could be something like CurrentTCIndex = nextCorrectionIndex(... )) > This kind of thing (discovering a new piece of functionality that is needed, or that something has to be done differently) is exactly why I wanted to get most of the delayed typo correction usage fleshed out and working before refactoring the Consumer. ;) Though peeking would be necessity change the Consumer's state because generating the next correction candidate is done lazily, at least the first time through the correction stream... and since multiple passes through the correction stream are only ever necessary when there are multiple TypoExprs within the same expression (and even then, not always needed), I'd prefer keeping the laziness as much as possible. > > >> >> On Wed, Oct 29, 2014 at 12:49 PM, Kaelyn Takata <[email protected]> wrote: >> >>> --- >>> include/clang/Sema/SemaInternal.h | 15 +++++++++++++++ >>> 1 file changed, 15 insertions(+) >>> >>> >>> _______________________________________________ >>> cfe-commits mailing list >>> [email protected] >>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >>> >>> >> >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
