On 24 Jul 2014, at 23:54, Stephen Leake <[email protected]> wrote: > > Do you mean the parser should insert a partial skeleton to fix a parser > error? That's an idea. But I don't think people would like it. And there > would be a HUGE number of skeletons required. > > It _might_ be possible to generate the skeletons from the wisi grammar; > that would solve one problem. > > Hmm; that might help in parser error recovery as well; the skeleton > completion is inserted _virtually_ to allow the parse to complete. > > Or it might be possible to add error recovery hints to the grammar. I > suspect that will be the best approach.
Yes, something like a best-effort recovery should help getting partial code into shape; another way in which the parsing information will benefit the purpose of language aware editing. > My reaction > would be "why is Emacs inserting all this crap in the code every time I > hit ENTER?”. (I thought the same the first time Eclipse suggested skeletons. OTOH, ask how may programmers turn off all completion in Xcode. I usually do not turn off bracketing magic in Eclipse.) > Note that a more typical case is modifying an existing subprogram. For > example, if we start with: > > procedure Foo (A : in Integer) > is begin > ... > end; > > And want to change to: > > procedure Foo > (A : in Integer; > B : in Float) > is begin > ... <add B to function calls in this code> > > <add other code that uses B> > > ... <no changes here> > end; > > I don't see how to use skeletons for this. > I wonder if this case of adding another argument to a profile is far less of a problem at Eurocontrol, that is, if indentation is only momentarily not working? If so, then there are cases when error recovery of completion via (virtual or real) skeletons is useful and others, when it seems overkill. Define the latter cases as those in which programmers will see less of a problem if indentation does not work for a moment (until the parser can catch up). _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
