On 29 Nov 2015, at 17:22, Simon Wright <[email protected]> wrote:
> 
> I've been having some trouble with aspects on complex declarations.
> 
> Given this:
> 
> package Imenu is
>   ...
>   type Date_Set is new Iterator_Interfaces.Forward_Iterator with private
>   with
>     Constant_Indexing => Element,
>     Default_Iterator  => Iterate,
>     Iterator_Element  => Ada.Calendar.Time;
> end Imenu;
> 
> C-c C-f fails with point after the 'd' of 'end', and
> 
> imenu.ada:83:3: wisi-containing-action: containing-token 'is' has no cache. 
> grammar error; missing action
> 
> I wondered whether this was caused by the unusual set of 
> 'wisi-containing-action's in
> 
> private_extension_declaration
>  : TYPE IDENTIFIER discriminant_part_opt IS abstract_limited_synchronized_opt 
> NEW subtype_indication
>    and_interface_list_opt WITH PRIVATE aspect_specification_opt SEMICOLON
>    (progn
>      (wisi-statement-action [1 statement-start 2 name 6 statement-other 12 
> statement-end])
>      (wisi-containing-action 1 3)
>      (wisi-containing-action 6 7)
>      (wisi-containing-action 6 8)
>      (wisi-containing-action 4 11)
>      (wisi-face-action [2 font-lock-type-face]))
>  ;

I changed ada-grammar.wy as

@@ -1787,7 +1789,7 @@
       (wisi-containing-action 1 3)
       (wisi-containing-action 6 7)
       (wisi-containing-action 6 8)
-      (wisi-containing-action 4 11)
+      (wisi-containing-action 1 11)
       (wisi-face-action [2 font-lock-type-face]))
   ;
 
and now I don't get a problem. (is this caused because token 4, the 'is', isn't 
referenced in 'wisi-statement-action'? if so, should it be, & if so, how?)

This gives me

   type T is new B with private
     with
       Aspect1,
       Aspect2;

   procedure P
   with Aspect;

and I'd quite like to align T's aspect_specification with 'type', like P's (or 
vice versa; consistently, anyway).


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

Reply via email to