This

package Protected_Type is

   protected type EXTI_Handler
   is new EXTI_IRQ_Handler with
      overriding
      entry Button_Pressed (B : out Interfaces.Unsigned_32);
   private
      Triggered       : Boolean := False;
      Last_Read_Value : Interfaces.Unsigned_32;
      procedure Handler;
      pragma Attach_Handler (Handler, Interrupt_Name);
   end EXTI_Handler;

   EXTI15_10_IRQ : aliased EXTI_Handler
     (Interrupt_Name => Ada.Interrupts.Names.EXTI15_10_IRQ);

end Protected_Type;

fails to indent.

C-c C-f fails with point after the Q of EXTI5_10_IRQ saying
protected_type.ads:14:13: wisi-containing-action: containing-token 'with' has 
no cache. grammar error; missing action

It looks to me as though the problem is that the ‘with’ needed to be marked in 
some way. I fumbled this patch

--- a/ada-grammar.wy    Sat Mar 28 17:46:32 2015 +0000
+++ b/ada-grammar.wy    Mon Mar 30 21:13:45 2015 +0100
@@ -1918,7 +1918,7 @@
   : PROTECTED TYPE IDENTIFIER discriminant_part_opt aspect_specification_opt 
IS NEW interface_list WITH
     protected_definition SEMICOLON
     (progn
-      (wisi-statement-action [1 statement-start 3 name 6 block-start 11 
statement-end])
+      (wisi-statement-action [1 statement-start 3 name 6 block-start 9 
statement-other 11 statement-end])
       (wisi-containing-action 1 3)
       (wisi-containing-action 3 5)
       (wisi-containing-action 9 10)

without knowing what I was doing; it’s getting somewhere, because indenting the 
whole file “succeeds” resulting in

package Protected_Type is

   protected type EXTI_Handler
   is new EXTI_IRQ_Handler with
overriding
entry Button_Pressed (B : out Interfaces.Unsigned_32);
   private
      Triggered       : Boolean := False;
      Last_Read_Value : Interfaces.Unsigned_32;
      procedure Handler;
      pragma Attach_Handler (Handler, Interrupt_Name);
   end EXTI_Handler;

   EXTI15_10_IRQ : aliased EXTI_Handler
     (Interrupt_Name => Ada.Interrupts.Names.EXTI15_10_IRQ);

end Protected_Type;

Any suggestions?

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

Reply via email to