Am 28.09.2013 um 17:21 schrieb Stephen Leake:

> I've pushed a revision with a first draft of ada-skel.el, implementing
> the token expansion I discussed. It only has 'case' and 'declare'
> tokens, but they work, and the parser accepts them. I changed
> ada-grammar.wy to allow empty sequence_of_statments and
> discrete_choice_list (easy!).
> 

C-c C-e works very nicely.


> I don't think skeletons for 'array' and 'procedure' are useful; the user
> has to provide most of the text in the minibuffer, and the skeleton only
> adds a few characters. It's easier to type all of it directly in the buffer.
> 
> So I will selectively copy skeletons from ada-mode 4.01.
> 

(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. It would be all right for me to type the parameter profile
into this basis template, just like in conditionals.  '_' in the function
skeleton could place the cursor accordingly. 

(That should be "return NAME;", now that I think of it, just like
gnatstub's scheme, restricted to NAME (from `str').

(Writing Ada 2005 containers' Iterate, Query_*, and Update_*
also incurs writing some procedures routinely, so maybe there is a case
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)

(2) A corresponding production, and then its non-terminal is added to the
production for "statement", in ada-grammar.wy.



_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to