Georg Bauhaus <[email protected]> writes:
> (For my purposes, I'd add basic support for functions. It was easy enough
> in your new setup. The reason is that I use local helper functions a lot,
> but find it annoying when I need to type "begin return; end Whatever;"
> again and again.
That's what C-c C-b `ada-make-subprogram-body' is for. You type the
function spec, including the ;, then hit C-c C-b.
> (Writing Ada 2005 containers' Iterate, Query_*, and Update_*
> also incurs writing some procedures routinely, so maybe there is a case
> for procedures, too.)
C-c C-b works for procedures, too.
>> I'll try adding placeholders to these skeletons as above. That will make it
>> clearer that the syntax is illegal and needs to be finished.
>
> I tried, somewhat naively, to allow "[Foo]" as a statement. It worked.
> Indentation seems to work, that is. To this end, I made two changes:
>
> (1) Characters '[' and ']' have comment syntax,
>
> + (modify-syntax-entry ?\[ "<]" table)
> (modify-syntax-entry ?\\ "." table); default is escape; not correct for
> Ada strings
> + (modify-syntax-entry ?\] ">[" table)
Ok, but I've switched to using generic comment syntax for placeholders;
see latest rev (just pushed).
Is there some reason to have both {} and [] placeholders? In Else, these
indicated "required" and "optional", but that distinction was more of a
bother than useful; the user can always delete a "required" placeholder,
and I often did.
> (2) A corresponding production, and then its non-terminal is added to the
> production for "statement", in ada-grammar.wy.
Since placeholders have comment syntax, they are ignored by the lexer,
so this should not be needed.
What is needed is allowing an empty sequence_of_statements, which is now
there (if it wasn't before).
However, I've not added placeholders in ada-skel, except for the header.
Until they are auto-deleted they are not very useful as pure
documentation.
--
-- Stephe
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org