cubesatlab / cubedos

A flight software framework in SPARK/Ada

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typed constants should be supported

pchapin opened this issue · comments

Mercury currently supports untyped integer constants such as:

const Maximum_Size = 1024;

Such constants are mapped to SPARK named number declarations. While this is useful, there are times when it would be appropriate to indicate a specific type. For example:

typedef unsigned int Size_Type range 0 .. 1024;
const Size_Type Threshold_Size = 512;

Here Threshold_Size should be mapped to a SPARK constant declaration such as:

Threshold_Size : constant Size_Type := 512;

At the moment Mercury issues a syntax error on the MXDR that uses typed constants.