Mercurial > emacs
annotate lisp/progmodes/ada-stmt.el @ 78076:dc2000c17cdd
*** empty log message ***
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sat, 07 Jul 2007 03:01:31 +0000 |
parents | e3694f1cb928 |
children | b6205894fe69 b8d9a391daf3 95d0cdf160ea |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34400
diff
changeset
|
1 ;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates |
23868 | 2 |
75347 | 3 ;; Copyright (C) 1987, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
4 ;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | |
23868 | 5 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34400
diff
changeset
|
6 ;; This file is part of GNU Emacs. |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
7 |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
8 ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de> |
73564
0058ef19e376
Change maintainer, apply whitespace-cleanup, checkdoc.
Juanma Barranquero <lekktu@gmail.com>
parents:
68773
diff
changeset
|
9 ;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org> |
23868 | 10 ;; Keywords: languages, ada |
11 | |
12 ;;; Commentary: | |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
13 ;; This file is now automatically loaded from ada-mode.el, and creates a submenu |
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
14 ;; in Ada/ on the menu bar. |
23868 | 15 |
16 ;;; History: | |
17 | |
18 ;; Created May 1987. | |
19 ;; Original version from V. Bowman as in ada.el of Emacs-18 | |
20 ;; (borrowed heavily from Mick Jordan's Modula-2 package for GNU, | |
21 ;; as modified by Peter Robinson, Michael Schmidt, and Tom Perrine.) | |
22 ;; | |
23 ;; Sep 1993. Daniel Pfeiffer <pfeiffer@cict.fr> (DP) | |
24 ;; Introduced statement.el for smaller code and user configurability. | |
25 ;; | |
26 ;; Nov 1993. Rolf Ebert <ebert@enpc.fr> (RE) Moved the | |
27 ;; skeleton generation into this separate file. The code still is | |
28 ;; essentially written by DP | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47744
diff
changeset
|
29 ;; |
23868 | 30 ;; Adapted Jun 1994. Markus Heritsch |
31 ;; <Markus.Heritsch@studbox.uni-stuttgart.de> (MH) | |
32 ;; added menu bar support for templates | |
33 ;; | |
34 ;; 1994/12/02 Christian Egli <cegli@hcsd.hac.com> | |
35 ;; General cleanup and bug fixes. | |
36 ;; | |
37 ;; 1995/12/20 John Hutchison <hutchiso@epi.syr.ge.com> | |
26226
b63d041c9108
Changed format of years in copyright notices.
Gerd Moellmann <gerd@gnu.org>
parents:
26000
diff
changeset
|
38 ;; made it work with skeleton.el from Emacs-19.30. Several |
23868 | 39 ;; enhancements and bug fixes. |
40 | |
41 ;; BUGS: | |
42 ;;;> I have the following suggestions for the function template: 1) I | |
43 ;;;> don't want it automatically assigning it a name for the return variable. I | |
44 ;;;> never want it to be called "Result" because that is nondescriptive. If you | |
45 ;;;> must define a variable, give me the ability to specify its name. | |
46 ;;;> | |
47 ;;;> 2) You do not provide a type for variable 'Result'. Its type is the same | |
48 ;;;> as the function's return type, which the template knows, so why force me | |
49 ;;;> to type it in? | |
50 ;;;> | |
51 | |
52 ;;;It would be nice if one could configure such layout details separately | |
53 ;;;without patching the LISP code. Maybe the metalanguage used in ada-stmt.el | |
54 ;;;could be taken even further, providing the user with some nice syntax | |
55 ;;;for describing layout. Then my own hacks would survive the next | |
56 ;;;update of the package :-) | |
57 | |
58 | |
59 ;;; Code: | |
60 | |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50739
diff
changeset
|
61 (require 'skeleton nil t) |
23868 | 62 (require 'easymenu) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50739
diff
changeset
|
63 (require 'ada-mode) |
23868 | 64 |
65 (defun ada-func-or-proc-name () | |
73564
0058ef19e376
Change maintainer, apply whitespace-cleanup, checkdoc.
Juanma Barranquero <lekktu@gmail.com>
parents:
68773
diff
changeset
|
66 "Return the name of the current function or procedure." |
23868 | 67 (save-excursion |
68 (let ((case-fold-search t)) | |
69 (if (re-search-backward ada-procedure-start-regexp nil t) | |
73933
f047602e0a17
(ada-func-or-proc-name): Match changes to ada-procedure-start-regexp.
Juanma Barranquero <lekktu@gmail.com>
parents:
73564
diff
changeset
|
70 (match-string 5) |
23868 | 71 "NAME?")))) |
72 | |
73 ;;; ---- statement skeletons ------------------------------------------ | |
74 | |
75 (define-skeleton ada-array | |
26000 | 76 "Insert array type definition. |
26226
b63d041c9108
Changed format of years in copyright notices.
Gerd Moellmann <gerd@gnu.org>
parents:
26000
diff
changeset
|
77 Prompt for component type and index subtypes." |
23868 | 78 () |
79 "array (" ("index definition: " str ", " ) -2 ") of " _ ?\;) | |
80 | |
81 | |
82 (define-skeleton ada-case | |
26000 | 83 "Build skeleton case statement. |
84 Prompt for the selector expression. Also builds the first when clause." | |
23868 | 85 "[selector expression]: " |
86 "case " str " is" \n | |
87 > "when " ("discrete choice: " str " | ") -3 " =>" \n | |
88 > _ \n | |
89 < < "end case;") | |
90 | |
91 | |
92 (define-skeleton ada-when | |
93 "Start a case statement alternative with a when clause." | |
94 () | |
95 < "when " ("discrete choice: " str " | ") -3 " =>" \n | |
96 >) | |
97 | |
98 | |
99 (define-skeleton ada-declare-block | |
100 "Insert a block with a declare part. | |
101 Indent for the first declaration." | |
102 "[block name]: " | |
103 < str & ?: & \n | |
104 > "declare" \n | |
105 > _ \n | |
106 < "begin" \n | |
107 > \n | |
108 < "end " str | -1 ?\;) | |
109 | |
110 | |
111 (define-skeleton ada-exception-block | |
112 "Insert a block with an exception part. | |
113 Indent for the first line of code." | |
114 "[block name]: " | |
115 < str & ?: & \n | |
116 > "begin" \n | |
117 > _ \n | |
118 < "exception" \n | |
119 > \n | |
120 < "end " str | -1 ?\;) | |
121 | |
122 | |
123 (define-skeleton ada-exception | |
124 "Insert an indented exception part into a block." | |
125 () | |
126 < "exception" \n | |
127 >) | |
128 | |
129 | |
130 (define-skeleton ada-exit-1 | |
131 "Insert then exit condition of the exit statement, prompting for condition." | |
132 "[exit condition]: " | |
133 "when " str | -5) | |
134 | |
135 | |
136 (define-skeleton ada-exit | |
137 "Insert an exit statement, prompting for loop name and condition." | |
138 "[name of loop to exit]: " | |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
139 "exit " str & ?\ (ada-exit-1) | -1 ?\;) |
23868 | 140 |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
141 ;;;###autoload |
23868 | 142 (defun ada-header () |
143 "Insert a descriptive header at the top of the file." | |
144 (interactive "*") | |
145 (save-excursion | |
146 (goto-char (point-min)) | |
147 (if (fboundp 'make-header) | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
148 (funcall (symbol-function 'make-header)) |
23868 | 149 (ada-header-tmpl)))) |
150 | |
151 | |
152 (define-skeleton ada-header-tmpl | |
153 "Insert a comment block containing the module title, author, etc." | |
154 "[Description]: " | |
155 "-- -*- Mode: Ada -*-" | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
156 "\n" ada-fill-comment-prefix "Filename : " (buffer-name) |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
157 "\n" ada-fill-comment-prefix "Description : " str |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
158 "\n" ada-fill-comment-prefix "Author : " (user-full-name) |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
159 "\n" ada-fill-comment-prefix "Created On : " (current-time-string) |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
160 "\n" ada-fill-comment-prefix "Last Modified By: ." |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
161 "\n" ada-fill-comment-prefix "Last Modified On: ." |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
162 "\n" ada-fill-comment-prefix "Update Count : 0" |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
163 "\n" ada-fill-comment-prefix "Status : Unknown, Use with caution!" |
23868 | 164 "\n") |
165 | |
166 | |
167 (define-skeleton ada-display-comment | |
168 "Inserts three comment lines, making a display comment." | |
169 () | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
170 "--\n" ada-fill-comment-prefix _ "\n--") |
23868 | 171 |
172 | |
173 (define-skeleton ada-if | |
174 "Insert skeleton if statment, prompting for a boolean-expression." | |
175 "[condition]: " | |
176 "if " str " then" \n | |
177 > _ \n | |
178 < "end if;") | |
179 | |
180 | |
181 (define-skeleton ada-elsif | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
182 "Add an elsif clause to an if statement, |
23868 | 183 prompting for the boolean-expression." |
184 "[condition]: " | |
185 < "elsif " str " then" \n | |
186 >) | |
187 | |
188 | |
189 (define-skeleton ada-else | |
190 "Add an else clause inside an if-then-end-if clause." | |
191 () | |
192 < "else" \n | |
193 >) | |
194 | |
195 | |
196 (define-skeleton ada-loop | |
197 "Insert a skeleton loop statement. The exit statement is added by hand." | |
198 "[loop name]: " | |
199 < str & ?: & \n | |
200 > "loop" \n | |
201 > _ \n | |
202 < "end loop " str | -1 ?\;) | |
203 | |
204 | |
205 (define-skeleton ada-for-loop-prompt-variable | |
206 "Prompt for the loop variable." | |
207 "[loop variable]: " | |
208 str) | |
209 | |
210 | |
211 (define-skeleton ada-for-loop-prompt-range | |
212 "Prompt for the loop range." | |
213 "[loop range]: " | |
214 str) | |
215 | |
216 | |
217 (define-skeleton ada-for-loop | |
218 "Build a skeleton for-loop statement, prompting for the loop parameters." | |
219 "[loop name]: " | |
220 < str & ?: & \n | |
221 > "for " | |
222 (ada-for-loop-prompt-variable) | |
223 " in " | |
224 (ada-for-loop-prompt-range) | |
225 " loop" \n | |
226 > _ \n | |
227 < "end loop " str | -1 ?\;) | |
228 | |
229 | |
230 (define-skeleton ada-while-loop-prompt-entry-condition | |
231 "Prompt for the loop entry condition." | |
232 "[entry condition]: " | |
233 str) | |
234 | |
235 | |
236 (define-skeleton ada-while-loop | |
237 "Insert a skeleton while loop statement." | |
238 "[loop name]: " | |
239 < str & ?: & \n | |
240 > "while " | |
241 (ada-while-loop-prompt-entry-condition) | |
242 " loop" \n | |
243 > _ \n | |
244 < "end loop " str | -1 ?\;) | |
245 | |
246 | |
247 (define-skeleton ada-package-spec | |
248 "Insert a skeleton package specification." | |
249 "[package name]: " | |
250 "package " str " is" \n | |
251 > _ \n | |
252 < "end " str ?\;) | |
253 | |
254 | |
255 (define-skeleton ada-package-body | |
256 "Insert a skeleton package body -- includes a begin statement." | |
257 "[package name]: " | |
258 "package body " str " is" \n | |
259 > _ \n | |
260 ; < "begin" \n | |
261 < "end " str ?\;) | |
262 | |
263 | |
264 (define-skeleton ada-private | |
265 "Undent and start a private section of a package spec. Reindent." | |
266 () | |
267 < "private" \n | |
268 >) | |
269 | |
270 | |
271 (define-skeleton ada-function-spec-prompt-return | |
272 "Prompts for function result type." | |
273 "[result type]: " | |
274 str) | |
275 | |
276 | |
277 (define-skeleton ada-function-spec | |
278 "Insert a function specification. Prompts for name and arguments." | |
279 "[function name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
280 "function " str |
23868 | 281 " (" ("[parameter_specification]: " str "; " ) -2 ")" |
282 " return " | |
283 (ada-function-spec-prompt-return) | |
284 ";" \n ) | |
285 | |
286 | |
287 (define-skeleton ada-procedure-spec | |
288 "Insert a procedure specification, prompting for its name and arguments." | |
289 "[procedure name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
290 "procedure " str |
23868 | 291 " (" ("[parameter_specification]: " str "; " ) -2 ")" |
292 ";" \n ) | |
293 | |
294 | |
295 (define-skeleton ada-subprogram-body | |
296 "Insert frame for subprogram body. | |
297 Invoke right after `ada-function-spec' or `ada-procedure-spec'." | |
298 () | |
299 ;; Remove `;' from subprogram decl | |
300 (save-excursion | |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
301 (let ((pos (1+ (point)))) |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
302 (ada-search-ignore-string-comment ada-subprog-start-re t nil) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
303 (when (ada-search-ignore-string-comment "(" nil pos t 'search-forward) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
304 (backward-char 1) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
305 (forward-sexp 1))) |
23868 | 306 (if (looking-at ";") |
73564
0058ef19e376
Change maintainer, apply whitespace-cleanup, checkdoc.
Juanma Barranquero <lekktu@gmail.com>
parents:
68773
diff
changeset
|
307 (delete-char 1))) |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
308 " is" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
309 _ \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
310 < "begin" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
311 \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
312 < "exception" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
313 "when others => null;" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
314 < < "end " |
23868 | 315 (ada-func-or-proc-name) |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
316 ";" \n) |
23868 | 317 |
318 | |
319 (define-skeleton ada-separate | |
320 "Finish a body stub with `separate'." | |
321 () | |
322 > "separate;" \n | |
323 <) | |
324 | |
325 | |
326 ;(define-skeleton ada-with | |
327 ; "Inserts a with clause, prompting for the list of units depended upon." | |
328 ; "[list of units depended upon]: " | |
329 ; "with " str ?\;) | |
330 | |
331 ;(define-skeleton ada-use | |
332 ; "Inserts a use clause, prompting for the list of packages used." | |
333 ; "[list of packages used]: " | |
334 ; "use " str ?\;) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47744
diff
changeset
|
335 |
23868 | 336 |
337 (define-skeleton ada-record | |
338 "Insert a skeleton record type declaration." | |
339 () | |
340 "record" \n | |
341 > _ \n | |
342 < "end record;") | |
343 | |
344 | |
345 (define-skeleton ada-subtype | |
346 "Start insertion of a subtype declaration, prompting for the subtype name." | |
347 "[subtype name]: " | |
348 "subtype " str " is " _ ?\; | |
349 (not (message "insert subtype indication."))) | |
350 | |
351 | |
352 (define-skeleton ada-type | |
353 "Start insertion of a type declaration, prompting for the type name." | |
354 "[type name]: " | |
355 "type " str ?\( | |
356 ("[discriminant specs]: " str " ") | |
357 | (backward-delete-char 1) | ?\) | |
358 " is " | |
359 (not (message "insert type definition."))) | |
360 | |
361 | |
362 (define-skeleton ada-task-body | |
363 "Insert a task body, prompting for the task name." | |
364 "[task name]: " | |
365 "task body " str " is\n" | |
366 "begin\n" | |
367 > _ \n | |
368 < "end " str ";" ) | |
369 | |
370 | |
371 (define-skeleton ada-task-spec | |
372 "Insert a task specification, prompting for the task name." | |
373 "[task name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
374 "task " str |
23868 | 375 " (" ("[discriminant]: " str "; ") ") is\n" |
376 > "entry " _ \n | |
377 <"end " str ";" ) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47744
diff
changeset
|
378 |
23868 | 379 |
380 (define-skeleton ada-get-param1 | |
381 "Prompt for arguments and if any enclose them in brackets." | |
382 () | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
383 ("[parameter_specification]: " str "; " ) & -2 & ")") |
23868 | 384 |
385 | |
386 (define-skeleton ada-get-param | |
387 "Prompt for arguments and if any enclose them in brackets." | |
388 () | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
389 " (" |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
390 (ada-get-param1) | -2) |
23868 | 391 |
392 | |
393 (define-skeleton ada-entry | |
394 "Insert a task entry, prompting for the entry name." | |
395 "[entry name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
396 "entry " str |
23868 | 397 (ada-get-param) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
398 ";" \n) |
23868 | 399 |
400 | |
401 (define-skeleton ada-entry-family-prompt-discriminant | |
402 "Insert a entry specification, prompting for the entry name." | |
403 "[discriminant name]: " | |
404 str) | |
405 | |
406 | |
407 (define-skeleton ada-entry-family | |
408 "Insert a entry specification, prompting for the entry name." | |
409 "[entry name]: " | |
410 "entry " str | |
411 " (" (ada-entry-family-prompt-discriminant) ")" | |
412 (ada-get-param) | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
413 ";" \n) |
23868 | 414 |
415 | |
416 (define-skeleton ada-select | |
417 "Insert a select block." | |
418 () | |
419 "select\n" | |
420 > _ \n | |
421 < "end select;") | |
422 | |
423 | |
424 (define-skeleton ada-accept-1 | |
425 "Insert a condition statement, prompting for the condition name." | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
426 "[condition]: " |
23868 | 427 "when " str | -5 ) |
428 | |
429 | |
430 (define-skeleton ada-accept-2 | |
431 "Insert an accept statement, prompting for the name and arguments." | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
432 "[accept name]: " |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
433 > "accept " str |
23868 | 434 (ada-get-param) |
435 " do" \n | |
436 > _ \n | |
437 < "end " str ";" ) | |
438 | |
439 | |
440 (define-skeleton ada-accept | |
441 "Insert an accept statement (prompt for condition, name and arguments)." | |
442 () | |
443 > (ada-accept-1) & " =>\n" | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
444 (ada-accept-2)) |
23868 | 445 |
446 | |
447 (define-skeleton ada-or-accept | |
73933
f047602e0a17
(ada-func-or-proc-name): Match changes to ada-procedure-start-regexp.
Juanma Barranquero <lekktu@gmail.com>
parents:
73564
diff
changeset
|
448 "Insert an accept alternative, prompting for the condition name." |
23868 | 449 () |
450 < "or\n" | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
451 (ada-accept)) |
23868 | 452 |
453 | |
454 (define-skeleton ada-or-delay | |
73933
f047602e0a17
(ada-func-or-proc-name): Match changes to ada-procedure-start-regexp.
Juanma Barranquero <lekktu@gmail.com>
parents:
73564
diff
changeset
|
455 "Insert a delay alternative, prompting for the delay value." |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
456 "[delay value]: " |
23868 | 457 < "or\n" |
458 > "delay " str ";") | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47744
diff
changeset
|
459 |
23868 | 460 |
461 (define-skeleton ada-or-terminate | |
73933
f047602e0a17
(ada-func-or-proc-name): Match changes to ada-procedure-start-regexp.
Juanma Barranquero <lekktu@gmail.com>
parents:
73564
diff
changeset
|
462 "Insert a terminate alternative." |
23868 | 463 () |
464 < "or\n" | |
465 > "terminate;") | |
466 | |
467 | |
468 (provide 'ada-stmt) | |
469 | |
52401 | 470 ;;; arch-tag: 94f51555-cc0e-44e5-8865-8788aae8ecd3 |
23868 | 471 ;;; ada-stmt.el ends here |