Simon Wright <[email protected]> writes:
> In the code below, I get this in *Messages* when I put point on one of the
> ‘with’ lines (or the region includes a ‘with’ line) and press TAB:
> if: Wrong type argument: number-or-marker-p, nil
>
> The format is fine if the region doesn’t include a ‘with’ line.
I finally got around to this. Here's a patch:
============================================================
--- ada-grammar.wy 0605758969df7583bb0b8f1b2f7b6671b39048e2
+++ ada-grammar.wy ac6dd7f7e1cb647a5f032b51db4dfa366bdf2108
@@ -1894,6 +1894,8 @@ protected_operation_item
: subprogram_declaration
| subprogram_body
| entry_body
+ | expression_function_declaration
+ | null_procedure_declaration
| aspect_clause
;
@@ -2230,7 +2232,7 @@ single_task_declaration
(wisi-face-action [2 font-lock-type-face]))
| TASK IDENTIFIER aspect_specification_opt SEMICOLON
(progn
- (wisi-statement-action [1 statement-start 4 statement-end])
+ (wisi-statement-action [1 statement-start 2 name 4 statement-end])
(wisi-containing-action 1 2)
(wisi-containing-action 2 3)
(wisi-face-action [2 font-lock-type-face]))
============================================================
--- ada-wisi.el 42e26d542986f0ff1f422432029ea46babb11d66
+++ ada-wisi.el a68fcfa8fbcab0e44bdce6ada3e065c219f51d77
@@ -563,8 +563,13 @@ point must be on CACHE. PREV-TOKEN is th
;; indenting 'new'; containing is 'with'
(+ (current-column) ada-indent-broken))
- ((full_type_declaration subtype_declaration)
- (while (not (memq (wisi-cache-token containing) '(TYPE
SUBTYPE)))
+ ((full_type_declaration
+ single_protected_declaration
+ single_task_declaration
+ subtype_declaration
+ task_type_declaration)
+
+ (while (not (memq (wisi-cache-token containing)
'(PROTECTED SUBTYPE TASK TYPE)))
(setq containing (wisi-goto-containing containing)))
(cond
@@ -578,6 +583,12 @@ point must be on CACHE. PREV-TOKEN is th
;; subtype Integer_String is String
;; with Dynamic_Predicate => Integer'Value
(Integer_String) in Integer
;; indenting 'with'
+ ;;
+ ;; test/ada_nominal.ads
+ ;; task type Task_Type_1 (Name : access String)
+ ;; with
+ ;; Storage_Size => 512 + 256
+ ;; indenting 'with'
type-col)
(null_private
I'm not entirely happy with the code structure in that part of
ada-wisi-before-cache; too many nested 'cond'. I'll have to think about
it.
--
-- Stephe
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org