[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Syntax failure with pragma
From: |
Simon Wright |
Subject: |
Syntax failure with pragma |
Date: |
Fri, 30 Jul 2021 16:17:12 +0100 |
Ada-mode doesn't accept this code
with Ada.Real_Time.Timing_Events;
package Pragma_In_PO is
protected type Flasher_Handler is
pragma Interrupt_Priority;
procedure Turn_Off_The_LED
(Event : in out Ada.Real_Time.Timing_Events.Timing_Event);
end Flasher_Handler;
end Pragma_In_PO;
C-c C-f says
wisi syntax errors
pragma_in_po.ads:2:8: match name error
pragma_in_po.ads:5:7: syntax error: expecting ENTRY, OVERRIDING, PRIVATE, FOR,
NOT, FUNCTION, PROCEDURE, END, NEW, found 'PRAGMA'
I've had the same problem with tasks. A workround is to use the corresponding
aspect
protected type Flasher_Handler
with Interrupt_Priority
is
procedure Turn_Off_The_LED
(Event : in out Ada.Real_Time.Timing_Events.Timing_Event);
end Flasher_Handler;
but of course that doesn't work if there isn't a corresponding aspect! (e.g.
pragma Task_Name).
- Syntax failure with pragma,
Simon Wright <=