57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
end Image;
function Value (Data : Atom) return Enum is
begin
return Enum'Value (To_Image (Data));
end Value;
function Value (Data : Atom; Default : Enum) return Enum is
Img : constant String := To_Image (Data);
begin
return Enum'Value (Img);
exception
when Constraint_Error =>
return Default;
end Value;
end Typed_IO;
end Natools.S_Expressions.Enumeration_IO;
|
|
|
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
end Image;
function Value (Data : Atom) return Enum is
begin
return Enum'Value (To_Image (Data));
end Value;
function Value (Data : Atom; Fallback : Enum) return Enum is
Img : constant String := To_Image (Data);
begin
return Enum'Value (Img);
exception
when Constraint_Error =>
return Fallback;
end Value;
end Typed_IO;
end Natools.S_Expressions.Enumeration_IO;
|