Natools

Check-in [0bd7339369]
Login
Overview
Comment:s_expressions-templates-dates: add a new command to override the time zone
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0bd73393691d30fe4183ae6c0c4a47815db609a0
User & Date: nat on 2015-06-24 18:20:30
Other Links: manifest | tags
Context
2015-06-25
17:01
s_expressions-templates-tests-dates: add a test for the new time zone override command check-in: 0dff00ad3f user: nat tags: trunk
2015-06-24
18:20
s_expressions-templates-dates: add a new command to override the time zone check-in: 0bd7339369 user: nat tags: trunk
2015-05-13
17:46
s_expressions-enumeration_io-tests: new test suite for S-expression I/O for enumeration values check-in: ef378b3624 user: nat tags: trunk
Changes

Modified generated/natools-static_maps-s_expressions-templates-dates-cmds.adb from [5d1f83d258] to [1e404f1ff7].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
with Interfaces; use Interfaces;

package body Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds is

   P : constant array (0 .. 5) of Natural :=
     (1, 2, 5, 11, 12, 15);

   T1 : constant array (0 .. 5) of Unsigned_8 :=
     (5, 22, 23, 31, 6, 10);

   T2 : constant array (0 .. 5) of Unsigned_8 :=
     (42, 40, 11, 44, 54, 41);

   G : constant array (0 .. 57) of Unsigned_8 :=
     (0, 0, 0, 0, 9, 0, 22, 3, 0, 0, 1, 11, 4, 0, 0, 0, 17, 0, 5, 0, 13, 0,
      0, 0, 0, 0, 0, 0, 0, 16, 0, 2, 0, 15, 0, 0, 5, 18, 0, 0, 0, 0, 6, 10,
      10, 20, 23, 0, 3, 3, 27, 16, 0, 20, 21, 9, 0, 22);

   function Hash (S : String) return Natural is
      F : constant Natural := S'First - 1;
      L : constant Natural := S'Length;
      F1, F2 : Natural := 0;
      J : Natural;
   begin
      for K in P'Range loop
         exit when L < P (K);
         J  := Character'Pos (S (P (K) + F));
         F1 := (F1 + Natural (T1 (K)) * J) mod 58;
         F2 := (F2 + Natural (T2 (K)) * J) mod 58;
      end loop;
      return (Natural (G (F1)) + Natural (G (F2))) mod 28;
   end Hash;

end Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;








|


|

|
|
|
|










|
|

|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
with Interfaces; use Interfaces;

package body Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds is

   P : constant array (0 .. 5) of Natural :=
     (1, 2, 5, 11, 12, 15);

   T1 : constant array (0 .. 5) of Unsigned_8 :=
     (3, 35, 48, 42, 15, 1);

   T2 : constant array (0 .. 5) of Unsigned_8 :=
     (30, 30, 25, 29, 48, 10);

   G : constant array (0 .. 60) of Unsigned_8 :=
     (0, 0, 0, 0, 0, 22, 0, 0, 12, 11, 0, 0, 0, 0, 0, 0, 13, 5, 0, 26, 17,
      0, 0, 6, 9, 0, 0, 0, 0, 10, 0, 24, 0, 0, 0, 0, 7, 6, 28, 16, 23, 0, 0,
      4, 28, 7, 21, 0, 8, 1, 9, 2, 0, 1, 5, 29, 0, 0, 3, 19, 0);

   function Hash (S : String) return Natural is
      F : constant Natural := S'First - 1;
      L : constant Natural := S'Length;
      F1, F2 : Natural := 0;
      J : Natural;
   begin
      for K in P'Range loop
         exit when L < P (K);
         J  := Character'Pos (S (P (K) + F));
         F1 := (F1 + Natural (T1 (K)) * J) mod 61;
         F2 := (F2 + Natural (T2 (K)) * J) mod 61;
      end loop;
      return (Natural (G (F1)) + Natural (G (F2))) mod 30;
   end Hash;

end Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;

Modified generated/natools-static_maps-s_expressions-templates-dates-t.adb from [5d9278d223] to [dae959be76].

1
2
3
4

5
6
7
8
9
10
11








12
13
14
15
16
17
--  Generated at 2014-10-03 21:03:09 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

with Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;

function Natools.Static_Maps.S_Expressions.Templates.Dates.T
  return Boolean is
begin
   for I in Map_1_Keys'Range loop
      if Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds.Hash
           (Map_1_Keys (I).all) /= I
      then








         return False;
      end if;
   end loop;

   return True;
end Natools.Static_Maps.S_Expressions.Templates.Dates.T;
|



>







>
>
>
>
>
>
>
>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--  Generated at 2015-06-24 18:19:13 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

with Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;
with Natools.Static_Maps.S_Expressions.Templates.Dates.Zones;
function Natools.Static_Maps.S_Expressions.Templates.Dates.T
  return Boolean is
begin
   for I in Map_1_Keys'Range loop
      if Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds.Hash
           (Map_1_Keys (I).all) /= I
      then
         return False;
      end if;
   end loop;

   for I in Map_2_Keys'Range loop
      if Natools.Static_Maps.S_Expressions.Templates.Dates.Zones.Hash
           (Map_2_Keys (I).all) /= I
      then
         return False;
      end if;
   end loop;

   return True;
end Natools.Static_Maps.S_Expressions.Templates.Dates.T;

Modified generated/natools-static_maps-s_expressions-templates-dates-t.ads from [5c1cef6658] to [25b531c072].

1
2
3
4
5
6
--  Generated at 2014-10-03 21:03:09 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

function Natools.Static_Maps.S_Expressions.Templates.Dates.T
  return Boolean;
pragma Pure (Natools.Static_Maps.S_Expressions.Templates.Dates.T);
|





1
2
3
4
5
6
--  Generated at 2015-06-24 18:19:13 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

function Natools.Static_Maps.S_Expressions.Templates.Dates.T
  return Boolean;
pragma Pure (Natools.Static_Maps.S_Expressions.Templates.Dates.T);

Added generated/natools-static_maps-s_expressions-templates-dates-zones.adb version [fd9e2e7f38].



































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
with Interfaces; use Interfaces;

package body Natools.Static_Maps.S_Expressions.Templates.Dates.Zones is

   P : constant array (0 .. 3) of Natural :=
     (1, 2, 3, 4);

   T1 : constant array (0 .. 3) of Unsigned_16 :=
     (174, 296, 87, 202);

   T2 : constant array (0 .. 3) of Unsigned_16 :=
     (5, 119, 245, 172);

   G : constant array (0 .. 332) of Unsigned_8 :=
     (0, 85, 0, 0, 71, 0, 0, 104, 0, 149, 0, 0, 145, 0, 100, 51, 134, 3, 0,
      0, 136, 22, 0, 43, 0, 133, 0, 0, 0, 0, 0, 0, 18, 106, 87, 110, 0, 48,
      0, 0, 63, 0, 52, 0, 0, 83, 42, 0, 0, 66, 0, 0, 0, 0, 0, 72, 0, 83, 0,
      36, 33, 157, 0, 41, 0, 156, 0, 0, 116, 11, 4, 0, 129, 125, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 4, 61, 0, 0, 80, 7, 35, 0, 0, 0, 0, 0, 30, 5,
      140, 81, 111, 74, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 45, 16, 2,
      108, 149, 109, 0, 0, 1, 0, 0, 158, 0, 164, 0, 139, 40, 0, 0, 0, 0, 0,
      116, 0, 0, 64, 129, 39, 159, 0, 0, 75, 5, 0, 0, 0, 55, 0, 106, 24,
      154, 0, 67, 86, 0, 9, 0, 65, 0, 50, 0, 0, 94, 47, 0, 0, 86, 6, 0, 61,
      0, 0, 75, 0, 38, 73, 30, 16, 120, 0, 0, 0, 16, 0, 0, 80, 0, 140, 44,
      146, 0, 0, 0, 0, 0, 27, 0, 0, 0, 90, 83, 32, 28, 0, 0, 104, 0, 83, 0,
      0, 0, 109, 16, 0, 112, 0, 0, 0, 66, 37, 0, 25, 70, 59, 70, 0, 24, 0,
      131, 0, 0, 0, 0, 45, 0, 0, 4, 0, 41, 97, 0, 0, 0, 17, 21, 0, 0, 0, 69,
      160, 5, 0, 0, 46, 64, 0, 68, 0, 5, 142, 8, 0, 0, 7, 79, 103, 77, 0, 0,
      138, 0, 163, 0, 43, 74, 0, 0, 134, 13, 54, 114, 51, 44, 0, 131, 32,
      13, 15, 148, 35, 94, 0, 31, 0, 0, 0, 144, 0, 84, 39, 0, 0, 125, 58, 0,
      0, 4, 12, 0, 0, 60, 11, 64, 0, 0, 0, 34, 14, 158, 145, 0, 23, 0, 143,
      163, 0, 96);

   function Hash (S : String) return Natural is
      F : constant Natural := S'First - 1;
      L : constant Natural := S'Length;
      F1, F2 : Natural := 0;
      J : Natural;
   begin
      for K in P'Range loop
         exit when L < P (K);
         J  := Character'Pos (S (P (K) + F));
         F1 := (F1 + Natural (T1 (K)) * J) mod 333;
         F2 := (F2 + Natural (T2 (K)) * J) mod 333;
      end loop;
      return (Natural (G (F1)) + Natural (G (F2))) mod 166;
   end Hash;

end Natools.Static_Maps.S_Expressions.Templates.Dates.Zones;

Added generated/natools-static_maps-s_expressions-templates-dates-zones.ads version [b0cce30fe8].









>
>
>
>
1
2
3
4
package Natools.Static_Maps.S_Expressions.Templates.Dates.Zones is
   pragma Pure;
   function Hash (S : String) return Natural;
end Natools.Static_Maps.S_Expressions.Templates.Dates.Zones;

Modified generated/natools-static_maps-s_expressions-templates-dates.adb from [3f158be03d] to [e6b2a37ac4].

1
2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18












19
--  Generated at 2014-10-03 21:03:09 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

with Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;


package body Natools.Static_Maps.S_Expressions.Templates.Dates is

   function Main (Key : String) return Main_Command is
      N : constant Natural
        := Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds.Hash (Key);
   begin
      if Map_1_Keys (N).all = Key then
         return Map_1_Elements (N);
      else
         return Error;
      end if;
   end Main;













end Natools.Static_Maps.S_Expressions.Templates.Dates;
|



>














>
>
>
>
>
>
>
>
>
>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--  Generated at 2015-06-24 18:19:13 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

with Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds;
with Natools.Static_Maps.S_Expressions.Templates.Dates.Zones;

package body Natools.Static_Maps.S_Expressions.Templates.Dates is

   function Main (Key : String) return Main_Command is
      N : constant Natural
        := Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds.Hash (Key);
   begin
      if Map_1_Keys (N).all = Key then
         return Map_1_Elements (N);
      else
         return Error;
      end if;
   end Main;


   function To_Time_Offset (Key : String) return Integer is
      N : constant Natural
        := Natools.Static_Maps.S_Expressions.Templates.Dates.Zones.Hash (Key);
   begin
      if Map_2_Keys (N).all = Key then
         return Map_2_Elements (N);
      else
         raise Constraint_Error with "Key """ & Key & """ not in map";
      end if;
   end To_Time_Offset;

end Natools.Static_Maps.S_Expressions.Templates.Dates;

Modified generated/natools-static_maps-s_expressions-templates-dates.ads from [2e200e79ce] to [3b5565e0f5].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
--  Generated at 2014-10-03 21:03:09 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

package Natools.Static_Maps.S_Expressions.Templates.Dates is
   pragma Pure;

   type Main_Command is
     (Error,
      Year, Month, Day, Hour, Minute, Second,
      Padded_Month, Padded_Day,
      Padded_Hour, Padded_Minute, Padded_Second,
      Day_Of_Week,
      Big_Endian_Date, Little_Endian_Date,
      Big_Endian_Time, Little_Endian_Time,
      RFC_3339);

   function Main (Key : String) return Main_Command;


private

   Map_1_Key_0 : aliased constant String := "YYYYMMDD";
   Map_1_Key_1 : aliased constant String := "big-endian-date";
   Map_1_Key_2 : aliased constant String := "HHMMSS";
   Map_1_Key_3 : aliased constant String := "time";
|













|


>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--  Generated at 2015-06-24 18:19:13 +0000 by Natools.Static_Hash_Maps
--  from src/natools-s_expressions-templates-dates-maps.sx

package Natools.Static_Maps.S_Expressions.Templates.Dates is
   pragma Pure;

   type Main_Command is
     (Error,
      Year, Month, Day, Hour, Minute, Second,
      Padded_Month, Padded_Day,
      Padded_Hour, Padded_Minute, Padded_Second,
      Day_Of_Week,
      Big_Endian_Date, Little_Endian_Date,
      Big_Endian_Time, Little_Endian_Time,
      RFC_3339, With_Offset);

   function Main (Key : String) return Main_Command;
   function To_Time_Offset (Key : String) return Integer;

private

   Map_1_Key_0 : aliased constant String := "YYYYMMDD";
   Map_1_Key_1 : aliased constant String := "big-endian-date";
   Map_1_Key_2 : aliased constant String := "HHMMSS";
   Map_1_Key_3 : aliased constant String := "time";
41
42
43
44
45
46
47
48


49
50
51
52
53
54
55
56
   Map_1_Key_20 : aliased constant String := "padded-minute";
   Map_1_Key_21 : aliased constant String := "0month";
   Map_1_Key_22 : aliased constant String := "padded-month";
   Map_1_Key_23 : aliased constant String := "0second";
   Map_1_Key_24 : aliased constant String := "padded-second";
   Map_1_Key_25 : aliased constant String := "rfc-3339";
   Map_1_Key_26 : aliased constant String := "second";
   Map_1_Key_27 : aliased constant String := "year";


   Map_1_Keys : constant array (0 .. 27) of access constant String
     := (Map_1_Key_0'Access,
         Map_1_Key_1'Access,
         Map_1_Key_2'Access,
         Map_1_Key_3'Access,
         Map_1_Key_4'Access,
         Map_1_Key_5'Access,
         Map_1_Key_6'Access,







|
>
>
|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
   Map_1_Key_20 : aliased constant String := "padded-minute";
   Map_1_Key_21 : aliased constant String := "0month";
   Map_1_Key_22 : aliased constant String := "padded-month";
   Map_1_Key_23 : aliased constant String := "0second";
   Map_1_Key_24 : aliased constant String := "padded-second";
   Map_1_Key_25 : aliased constant String := "rfc-3339";
   Map_1_Key_26 : aliased constant String := "second";
   Map_1_Key_27 : aliased constant String := "with-offset";
   Map_1_Key_28 : aliased constant String := "in-zone";
   Map_1_Key_29 : aliased constant String := "year";
   Map_1_Keys : constant array (0 .. 29) of access constant String
     := (Map_1_Key_0'Access,
         Map_1_Key_1'Access,
         Map_1_Key_2'Access,
         Map_1_Key_3'Access,
         Map_1_Key_4'Access,
         Map_1_Key_5'Access,
         Map_1_Key_6'Access,
70
71
72
73
74
75
76
77


78
79
80
81
82
83
84
85
         Map_1_Key_20'Access,
         Map_1_Key_21'Access,
         Map_1_Key_22'Access,
         Map_1_Key_23'Access,
         Map_1_Key_24'Access,
         Map_1_Key_25'Access,
         Map_1_Key_26'Access,
         Map_1_Key_27'Access);


   Map_1_Elements : constant array (0 .. 27) of Main_Command
     := (Big_Endian_Date,
         Big_Endian_Date,
         Big_Endian_Time,
         Big_Endian_Time,
         Big_Endian_Time,
         Day,
         Day_Of_Week,







|
>
>
|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
         Map_1_Key_20'Access,
         Map_1_Key_21'Access,
         Map_1_Key_22'Access,
         Map_1_Key_23'Access,
         Map_1_Key_24'Access,
         Map_1_Key_25'Access,
         Map_1_Key_26'Access,
         Map_1_Key_27'Access,
         Map_1_Key_28'Access,
         Map_1_Key_29'Access);
   Map_1_Elements : constant array (0 .. 29) of Main_Command
     := (Big_Endian_Date,
         Big_Endian_Date,
         Big_Endian_Time,
         Big_Endian_Time,
         Big_Endian_Time,
         Day,
         Day_Of_Week,
99
100
101
102
103
104
105


106





















































































































































































































































































































































































































































































































107
108
         Padded_Minute,
         Padded_Month,
         Padded_Month,
         Padded_Second,
         Padded_Second,
         RFC_3339,
         Second,


         Year);






















































































































































































































































































































































































































































































































end Natools.Static_Maps.S_Expressions.Templates.Dates;







>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
         Padded_Minute,
         Padded_Month,
         Padded_Month,
         Padded_Second,
         Padded_Second,
         RFC_3339,
         Second,
         With_Offset,
         With_Offset,
         Year);

   Map_2_Key_0 : aliased constant String := "ACDT";
   Map_2_Key_1 : aliased constant String := "ACST";
   Map_2_Key_2 : aliased constant String := "ADT";
   Map_2_Key_3 : aliased constant String := "AEDT";
   Map_2_Key_4 : aliased constant String := "AEST";
   Map_2_Key_5 : aliased constant String := "AFT";
   Map_2_Key_6 : aliased constant String := "AKDT";
   Map_2_Key_7 : aliased constant String := "AKST";
   Map_2_Key_8 : aliased constant String := "ART";
   Map_2_Key_9 : aliased constant String := "AWDT";
   Map_2_Key_10 : aliased constant String := "AWST";
   Map_2_Key_11 : aliased constant String := "AZOST";
   Map_2_Key_12 : aliased constant String := "AZT";
   Map_2_Key_13 : aliased constant String := "BDT";
   Map_2_Key_14 : aliased constant String := "BIOT";
   Map_2_Key_15 : aliased constant String := "BIT";
   Map_2_Key_16 : aliased constant String := "BOT";
   Map_2_Key_17 : aliased constant String := "BRST";
   Map_2_Key_18 : aliased constant String := "BRT";
   Map_2_Key_19 : aliased constant String := "BTT";
   Map_2_Key_20 : aliased constant String := "CAT";
   Map_2_Key_21 : aliased constant String := "CCT";
   Map_2_Key_22 : aliased constant String := "CEDT";
   Map_2_Key_23 : aliased constant String := "CEST";
   Map_2_Key_24 : aliased constant String := "CET";
   Map_2_Key_25 : aliased constant String := "CHADT";
   Map_2_Key_26 : aliased constant String := "CHAST";
   Map_2_Key_27 : aliased constant String := "CHOT";
   Map_2_Key_28 : aliased constant String := "ChST";
   Map_2_Key_29 : aliased constant String := "CHUT";
   Map_2_Key_30 : aliased constant String := "CIST";
   Map_2_Key_31 : aliased constant String := "CIT";
   Map_2_Key_32 : aliased constant String := "CKT";
   Map_2_Key_33 : aliased constant String := "CLST";
   Map_2_Key_34 : aliased constant String := "CLT";
   Map_2_Key_35 : aliased constant String := "COST";
   Map_2_Key_36 : aliased constant String := "COT";
   Map_2_Key_37 : aliased constant String := "CT";
   Map_2_Key_38 : aliased constant String := "CVT";
   Map_2_Key_39 : aliased constant String := "CWST";
   Map_2_Key_40 : aliased constant String := "CXT";
   Map_2_Key_41 : aliased constant String := "DAVT";
   Map_2_Key_42 : aliased constant String := "DDUT";
   Map_2_Key_43 : aliased constant String := "DFT";
   Map_2_Key_44 : aliased constant String := "EASST";
   Map_2_Key_45 : aliased constant String := "EAST";
   Map_2_Key_46 : aliased constant String := "EAT";
   Map_2_Key_47 : aliased constant String := "EDT";
   Map_2_Key_48 : aliased constant String := "EEDT";
   Map_2_Key_49 : aliased constant String := "EEST";
   Map_2_Key_50 : aliased constant String := "EET";
   Map_2_Key_51 : aliased constant String := "EGST";
   Map_2_Key_52 : aliased constant String := "EGT";
   Map_2_Key_53 : aliased constant String := "EIT";
   Map_2_Key_54 : aliased constant String := "FET";
   Map_2_Key_55 : aliased constant String := "FJT";
   Map_2_Key_56 : aliased constant String := "FKST";
   Map_2_Key_57 : aliased constant String := "FKT";
   Map_2_Key_58 : aliased constant String := "FNT";
   Map_2_Key_59 : aliased constant String := "GALT";
   Map_2_Key_60 : aliased constant String := "GAMT";
   Map_2_Key_61 : aliased constant String := "GET";
   Map_2_Key_62 : aliased constant String := "GFT";
   Map_2_Key_63 : aliased constant String := "GILT";
   Map_2_Key_64 : aliased constant String := "GIT";
   Map_2_Key_65 : aliased constant String := "GMT";
   Map_2_Key_66 : aliased constant String := "GYT";
   Map_2_Key_67 : aliased constant String := "HADT";
   Map_2_Key_68 : aliased constant String := "HAEC";
   Map_2_Key_69 : aliased constant String := "HAST";
   Map_2_Key_70 : aliased constant String := "HKT";
   Map_2_Key_71 : aliased constant String := "HMT";
   Map_2_Key_72 : aliased constant String := "HOVT";
   Map_2_Key_73 : aliased constant String := "HST";
   Map_2_Key_74 : aliased constant String := "ICT";
   Map_2_Key_75 : aliased constant String := "IDT";
   Map_2_Key_76 : aliased constant String := "IOT";
   Map_2_Key_77 : aliased constant String := "IRDT";
   Map_2_Key_78 : aliased constant String := "IRKT";
   Map_2_Key_79 : aliased constant String := "IRST";
   Map_2_Key_80 : aliased constant String := "JST";
   Map_2_Key_81 : aliased constant String := "KGT";
   Map_2_Key_82 : aliased constant String := "KOST";
   Map_2_Key_83 : aliased constant String := "KRAT";
   Map_2_Key_84 : aliased constant String := "KST";
   Map_2_Key_85 : aliased constant String := "LINT";
   Map_2_Key_86 : aliased constant String := "MAGT";
   Map_2_Key_87 : aliased constant String := "MART";
   Map_2_Key_88 : aliased constant String := "MAWT";
   Map_2_Key_89 : aliased constant String := "MDT";
   Map_2_Key_90 : aliased constant String := "MET";
   Map_2_Key_91 : aliased constant String := "MEST";
   Map_2_Key_92 : aliased constant String := "MHT";
   Map_2_Key_93 : aliased constant String := "MIST";
   Map_2_Key_94 : aliased constant String := "MIT";
   Map_2_Key_95 : aliased constant String := "MMT";
   Map_2_Key_96 : aliased constant String := "MSK";
   Map_2_Key_97 : aliased constant String := "MUT";
   Map_2_Key_98 : aliased constant String := "MVT";
   Map_2_Key_99 : aliased constant String := "MYT";
   Map_2_Key_100 : aliased constant String := "NCT";
   Map_2_Key_101 : aliased constant String := "NDT";
   Map_2_Key_102 : aliased constant String := "NFT";
   Map_2_Key_103 : aliased constant String := "NPT";
   Map_2_Key_104 : aliased constant String := "NST";
   Map_2_Key_105 : aliased constant String := "NT";
   Map_2_Key_106 : aliased constant String := "NUT";
   Map_2_Key_107 : aliased constant String := "NZDT";
   Map_2_Key_108 : aliased constant String := "NZST";
   Map_2_Key_109 : aliased constant String := "OMST";
   Map_2_Key_110 : aliased constant String := "ORAT";
   Map_2_Key_111 : aliased constant String := "PDT";
   Map_2_Key_112 : aliased constant String := "PET";
   Map_2_Key_113 : aliased constant String := "PETT";
   Map_2_Key_114 : aliased constant String := "PGT";
   Map_2_Key_115 : aliased constant String := "PHOT";
   Map_2_Key_116 : aliased constant String := "PKT";
   Map_2_Key_117 : aliased constant String := "PMDT";
   Map_2_Key_118 : aliased constant String := "PMST";
   Map_2_Key_119 : aliased constant String := "PONT";
   Map_2_Key_120 : aliased constant String := "PYST";
   Map_2_Key_121 : aliased constant String := "PYT";
   Map_2_Key_122 : aliased constant String := "RET";
   Map_2_Key_123 : aliased constant String := "ROTT";
   Map_2_Key_124 : aliased constant String := "SAKT";
   Map_2_Key_125 : aliased constant String := "SAMT";
   Map_2_Key_126 : aliased constant String := "SAST";
   Map_2_Key_127 : aliased constant String := "SBT";
   Map_2_Key_128 : aliased constant String := "SCT";
   Map_2_Key_129 : aliased constant String := "SGT";
   Map_2_Key_130 : aliased constant String := "SLST";
   Map_2_Key_131 : aliased constant String := "SRET";
   Map_2_Key_132 : aliased constant String := "SRT";
   Map_2_Key_133 : aliased constant String := "SYOT";
   Map_2_Key_134 : aliased constant String := "TAHT";
   Map_2_Key_135 : aliased constant String := "THA";
   Map_2_Key_136 : aliased constant String := "TFT";
   Map_2_Key_137 : aliased constant String := "TJT";
   Map_2_Key_138 : aliased constant String := "TKT";
   Map_2_Key_139 : aliased constant String := "TLT";
   Map_2_Key_140 : aliased constant String := "TMT";
   Map_2_Key_141 : aliased constant String := "TOT";
   Map_2_Key_142 : aliased constant String := "TVT";
   Map_2_Key_143 : aliased constant String := "UCT";
   Map_2_Key_144 : aliased constant String := "ULAT";
   Map_2_Key_145 : aliased constant String := "USZ1";
   Map_2_Key_146 : aliased constant String := "UTC";
   Map_2_Key_147 : aliased constant String := "UYST";
   Map_2_Key_148 : aliased constant String := "UYT";
   Map_2_Key_149 : aliased constant String := "UZT";
   Map_2_Key_150 : aliased constant String := "VET";
   Map_2_Key_151 : aliased constant String := "VLAT";
   Map_2_Key_152 : aliased constant String := "VOLT";
   Map_2_Key_153 : aliased constant String := "VOST";
   Map_2_Key_154 : aliased constant String := "VUT";
   Map_2_Key_155 : aliased constant String := "WAKT";
   Map_2_Key_156 : aliased constant String := "WAST";
   Map_2_Key_157 : aliased constant String := "WAT";
   Map_2_Key_158 : aliased constant String := "WEDT";
   Map_2_Key_159 : aliased constant String := "WEST";
   Map_2_Key_160 : aliased constant String := "WET";
   Map_2_Key_161 : aliased constant String := "WIT";
   Map_2_Key_162 : aliased constant String := "WST";
   Map_2_Key_163 : aliased constant String := "YAKT";
   Map_2_Key_164 : aliased constant String := "YEKT";
   Map_2_Key_165 : aliased constant String := "Z";
   Map_2_Keys : constant array (0 .. 165) of access constant String
     := (Map_2_Key_0'Access,
         Map_2_Key_1'Access,
         Map_2_Key_2'Access,
         Map_2_Key_3'Access,
         Map_2_Key_4'Access,
         Map_2_Key_5'Access,
         Map_2_Key_6'Access,
         Map_2_Key_7'Access,
         Map_2_Key_8'Access,
         Map_2_Key_9'Access,
         Map_2_Key_10'Access,
         Map_2_Key_11'Access,
         Map_2_Key_12'Access,
         Map_2_Key_13'Access,
         Map_2_Key_14'Access,
         Map_2_Key_15'Access,
         Map_2_Key_16'Access,
         Map_2_Key_17'Access,
         Map_2_Key_18'Access,
         Map_2_Key_19'Access,
         Map_2_Key_20'Access,
         Map_2_Key_21'Access,
         Map_2_Key_22'Access,
         Map_2_Key_23'Access,
         Map_2_Key_24'Access,
         Map_2_Key_25'Access,
         Map_2_Key_26'Access,
         Map_2_Key_27'Access,
         Map_2_Key_28'Access,
         Map_2_Key_29'Access,
         Map_2_Key_30'Access,
         Map_2_Key_31'Access,
         Map_2_Key_32'Access,
         Map_2_Key_33'Access,
         Map_2_Key_34'Access,
         Map_2_Key_35'Access,
         Map_2_Key_36'Access,
         Map_2_Key_37'Access,
         Map_2_Key_38'Access,
         Map_2_Key_39'Access,
         Map_2_Key_40'Access,
         Map_2_Key_41'Access,
         Map_2_Key_42'Access,
         Map_2_Key_43'Access,
         Map_2_Key_44'Access,
         Map_2_Key_45'Access,
         Map_2_Key_46'Access,
         Map_2_Key_47'Access,
         Map_2_Key_48'Access,
         Map_2_Key_49'Access,
         Map_2_Key_50'Access,
         Map_2_Key_51'Access,
         Map_2_Key_52'Access,
         Map_2_Key_53'Access,
         Map_2_Key_54'Access,
         Map_2_Key_55'Access,
         Map_2_Key_56'Access,
         Map_2_Key_57'Access,
         Map_2_Key_58'Access,
         Map_2_Key_59'Access,
         Map_2_Key_60'Access,
         Map_2_Key_61'Access,
         Map_2_Key_62'Access,
         Map_2_Key_63'Access,
         Map_2_Key_64'Access,
         Map_2_Key_65'Access,
         Map_2_Key_66'Access,
         Map_2_Key_67'Access,
         Map_2_Key_68'Access,
         Map_2_Key_69'Access,
         Map_2_Key_70'Access,
         Map_2_Key_71'Access,
         Map_2_Key_72'Access,
         Map_2_Key_73'Access,
         Map_2_Key_74'Access,
         Map_2_Key_75'Access,
         Map_2_Key_76'Access,
         Map_2_Key_77'Access,
         Map_2_Key_78'Access,
         Map_2_Key_79'Access,
         Map_2_Key_80'Access,
         Map_2_Key_81'Access,
         Map_2_Key_82'Access,
         Map_2_Key_83'Access,
         Map_2_Key_84'Access,
         Map_2_Key_85'Access,
         Map_2_Key_86'Access,
         Map_2_Key_87'Access,
         Map_2_Key_88'Access,
         Map_2_Key_89'Access,
         Map_2_Key_90'Access,
         Map_2_Key_91'Access,
         Map_2_Key_92'Access,
         Map_2_Key_93'Access,
         Map_2_Key_94'Access,
         Map_2_Key_95'Access,
         Map_2_Key_96'Access,
         Map_2_Key_97'Access,
         Map_2_Key_98'Access,
         Map_2_Key_99'Access,
         Map_2_Key_100'Access,
         Map_2_Key_101'Access,
         Map_2_Key_102'Access,
         Map_2_Key_103'Access,
         Map_2_Key_104'Access,
         Map_2_Key_105'Access,
         Map_2_Key_106'Access,
         Map_2_Key_107'Access,
         Map_2_Key_108'Access,
         Map_2_Key_109'Access,
         Map_2_Key_110'Access,
         Map_2_Key_111'Access,
         Map_2_Key_112'Access,
         Map_2_Key_113'Access,
         Map_2_Key_114'Access,
         Map_2_Key_115'Access,
         Map_2_Key_116'Access,
         Map_2_Key_117'Access,
         Map_2_Key_118'Access,
         Map_2_Key_119'Access,
         Map_2_Key_120'Access,
         Map_2_Key_121'Access,
         Map_2_Key_122'Access,
         Map_2_Key_123'Access,
         Map_2_Key_124'Access,
         Map_2_Key_125'Access,
         Map_2_Key_126'Access,
         Map_2_Key_127'Access,
         Map_2_Key_128'Access,
         Map_2_Key_129'Access,
         Map_2_Key_130'Access,
         Map_2_Key_131'Access,
         Map_2_Key_132'Access,
         Map_2_Key_133'Access,
         Map_2_Key_134'Access,
         Map_2_Key_135'Access,
         Map_2_Key_136'Access,
         Map_2_Key_137'Access,
         Map_2_Key_138'Access,
         Map_2_Key_139'Access,
         Map_2_Key_140'Access,
         Map_2_Key_141'Access,
         Map_2_Key_142'Access,
         Map_2_Key_143'Access,
         Map_2_Key_144'Access,
         Map_2_Key_145'Access,
         Map_2_Key_146'Access,
         Map_2_Key_147'Access,
         Map_2_Key_148'Access,
         Map_2_Key_149'Access,
         Map_2_Key_150'Access,
         Map_2_Key_151'Access,
         Map_2_Key_152'Access,
         Map_2_Key_153'Access,
         Map_2_Key_154'Access,
         Map_2_Key_155'Access,
         Map_2_Key_156'Access,
         Map_2_Key_157'Access,
         Map_2_Key_158'Access,
         Map_2_Key_159'Access,
         Map_2_Key_160'Access,
         Map_2_Key_161'Access,
         Map_2_Key_162'Access,
         Map_2_Key_163'Access,
         Map_2_Key_164'Access,
         Map_2_Key_165'Access);
   Map_2_Elements : constant array (0 .. 165) of Integer
     := (+10 * 60 + 30,
         +09 * 60 + 30,
         -03 * 60,
         +11 * 60,
         +10 * 60,
         +04 * 60 + 30,
         -08 * 60,
         -09 * 60,
         -03 * 60,
         +09 * 60,
         +08 * 60,
         -01 * 60,
         +04 * 60,
         +08 * 60,
         +06 * 60,
         -12 * 60,
         -04 * 60,
         -02 * 60,
         -03 * 60,
         +06 * 60,
         +02 * 60,
         +06 * 60 + 30,
         +02 * 60,
         +02 * 60,
         +01 * 60,
         +13 * 60 + 45,
         +12 * 60 + 45,
         +08 * 60,
         +10 * 60,
         +10 * 60,
         -08 * 60,
         +08 * 60,
         -10 * 60,
         -03 * 60,
         -04 * 60,
         -04 * 60,
         -05 * 60,
         +08 * 60,
         -01 * 60,
         +08 * 60 + 45,
         +07 * 60,
         +07 * 60,
         +10 * 60,
         +01 * 60,
         -05 * 60,
         -06 * 60,
         +03 * 60,
         -04 * 60,
         +03 * 60,
         +03 * 60,
         +02 * 60,
         +00 * 60,
         -01 * 60,
         +09 * 60,
         +03 * 60,
         +12 * 60,
         -03 * 60,
         -04 * 60,
         -02 * 60,
         -06 * 60,
         -09 * 60,
         +04 * 60,
         -03 * 60,
         +12 * 60,
         -09 * 60,
         0,
         -04 * 60,
         -09 * 60,
         +02 * 60,
         -10 * 60,
         +08 * 60,
         +05 * 60,
         +07 * 60,
         -10 * 60,
         +07 * 60,
         +03 * 60,
         +03 * 60,
         +04 * 60 + 30,
         +08 * 60,
         +03 * 60 + 30,
         +09 * 60,
         +06 * 60,
         +11 * 60,
         +07 * 60,
         +09 * 60,
         +14 * 60,
         +12 * 60,
         -09 * 60 + 30,
         +05 * 60,
         -06 * 60,
         +01 * 60,
         +02 * 60,
         +12 * 60,
         +11 * 60,
         -09 * 60 + 30,
         +06 * 60 + 30,
         +03 * 60,
         +04 * 60,
         +05 * 60,
         +08 * 60,
         +11 * 60,
         -02 * 60 + 30,
         +11 * 60 + 30,
         +05 * 60 + 45,
         -03 * 60 + 30,
         -03 * 60 + 30,
         -11 * 60,
         +13 * 60,
         +12 * 60,
         +06 * 60,
         +05 * 60,
         -07 * 60,
         -05 * 60,
         +12 * 60,
         +10 * 60,
         +13 * 60,
         +05 * 60,
         -02 * 60,
         -03 * 60,
         +11 * 60,
         -03 * 60,
         -04 * 60,
         +04 * 60,
         -03 * 60,
         +11 * 60,
         +04 * 60,
         +02 * 60,
         +11 * 60,
         +04 * 60,
         +08 * 60,
         +05 * 60 + 30,
         +11 * 60,
         -03 * 60,
         +03 * 60,
         -10 * 60,
         +07 * 60,
         +05 * 60,
         +05 * 60,
         +13 * 60,
         +09 * 60,
         +05 * 60,
         +13 * 60,
         +12 * 60,
         0,
         +08 * 60,
         +02 * 60,
         0,
         -02 * 60,
         -03 * 60,
         +05 * 60,
         -04 * 60 + 30,
         +10 * 60,
         +04 * 60,
         +06 * 60,
         +11 * 60,
         +12 * 60,
         +02 * 60,
         +01 * 60,
         +01 * 60,
         +01 * 60,
         0,
         +07 * 60,
         +08 * 60,
         +09 * 60,
         +05 * 60,
         0);

end Natools.Static_Maps.S_Expressions.Templates.Dates;

Modified src/natools-s_expressions-templates-dates-maps.sx from [7ffcc36068] to [c3de526828].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(Natools.Static_Maps.S_Expressions.Templates.Dates
   pure
   (test-function T)
   (extra-decl "\
   type Main_Command is
     (Error,
      Year, Month, Day, Hour, Minute, Second,
      Padded_Month, Padded_Day,
      Padded_Hour, Padded_Minute, Padded_Second,
      Day_Of_Week,
      Big_Endian_Date, Little_Endian_Date,
      Big_Endian_Time, Little_Endian_Time,
      RFC_3339);")
   (Main_Command
      (hash-package Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds)
      (function Main)
      (not-found Error)
      (nodes
         (Big_Endian_Date     YYYYMMDD big-endian-date)
         (Big_Endian_Time     HHMMSS time big-endian-time)












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(Natools.Static_Maps.S_Expressions.Templates.Dates
   pure
   (test-function T)
   (extra-decl "\
   type Main_Command is
     (Error,
      Year, Month, Day, Hour, Minute, Second,
      Padded_Month, Padded_Day,
      Padded_Hour, Padded_Minute, Padded_Second,
      Day_Of_Week,
      Big_Endian_Date, Little_Endian_Date,
      Big_Endian_Time, Little_Endian_Time,
      RFC_3339, With_Offset);")
   (Main_Command
      (hash-package Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds)
      (function Main)
      (not-found Error)
      (nodes
         (Big_Endian_Date     YYYYMMDD big-endian-date)
         (Big_Endian_Time     HHMMSS time big-endian-time)
28
29
30
31
32
33
34

35










































































































































































         (Padded_Day          0day padded-day)
         (Padded_Hour         0hour padded-hour)
         (Padded_Minute       0minute padded-minute)
         (Padded_Month        0month padded-month)
         (Padded_Second       0second padded-second)
         (RFC_3339            rfc-3339)
         (Second              second)

         (Year                year))))

















































































































































































>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
         (Padded_Day          0day padded-day)
         (Padded_Hour         0hour padded-hour)
         (Padded_Minute       0minute padded-minute)
         (Padded_Month        0month padded-month)
         (Padded_Second       0second padded-second)
         (RFC_3339            rfc-3339)
         (Second              second)
         (With_Offset         with-offset in-zone)
         (Year                year)))
   (Integer
      (hash-package Natools.Static_Maps.S_Expressions.Templates.Dates.Zones)
      (function To_Time_Offset)
      (nodes
         ("+10 * 60 + 30"  ACDT)
         ("+09 * 60 + 30"  ACST)
         ("-03 * 60"       ADT)
         ("+11 * 60"       AEDT)
         ("+10 * 60"       AEST)
         ("+04 * 60 + 30"  AFT)
         ("-08 * 60"       AKDT)
         ("-09 * 60"       AKST)
         ("-03 * 60"       ART)
         ("+09 * 60"       AWDT)
         ("+08 * 60"       AWST)
         ("-01 * 60"       AZOST)
         ("+04 * 60"       AZT)
         ("+08 * 60"       BDT)
         ("+06 * 60"       BIOT)
         ("-12 * 60"       BIT)
         ("-04 * 60"       BOT)
         ("-02 * 60"       BRST)
         ("-03 * 60"       BRT)
         ("+06 * 60"       BTT)
         ("+02 * 60"       CAT)
         ("+06 * 60 + 30"  CCT)
         ("+02 * 60"       CEDT)
         ("+02 * 60"       CEST)
         ("+01 * 60"       CET)
         ("+13 * 60 + 45"  CHADT)
         ("+12 * 60 + 45"  CHAST)
         ("+08 * 60"       CHOT)
         ("+10 * 60"       ChST)
         ("+10 * 60"       CHUT)
         ("-08 * 60"       CIST)
         ("+08 * 60"       CIT)
         ("-10 * 60"       CKT)
         ("-03 * 60"       CLST)
         ("-04 * 60"       CLT)
         ("-04 * 60"       COST)
         ("-05 * 60"       COT)
         ("+08 * 60"       CT)
         ("-01 * 60"       CVT)
         ("+08 * 60 + 45"  CWST)
         ("+07 * 60"       CXT)
         ("+07 * 60"       DAVT)
         ("+10 * 60"       DDUT)
         ("+01 * 60"       DFT)
         ("-05 * 60"       EASST)
         ("-06 * 60"       EAST)
         ("+03 * 60"       EAT)
         ("-04 * 60"       EDT)
         ("+03 * 60"       EEDT)
         ("+03 * 60"       EEST)
         ("+02 * 60"       EET)
         ("+00 * 60"       EGST)
         ("-01 * 60"       EGT)
         ("+09 * 60"       EIT)
         ("+03 * 60"       FET)
         ("+12 * 60"       FJT)
         ("-03 * 60"       FKST)
         ("-04 * 60"       FKT)
         ("-02 * 60"       FNT)
         ("-06 * 60"       GALT)
         ("-09 * 60"       GAMT)
         ("+04 * 60"       GET)
         ("-03 * 60"       GFT)
         ("+12 * 60"       GILT)
         ("-09 * 60"       GIT)
         ("0"              GMT)
         ("-04 * 60"       GYT)
         ("-09 * 60"       HADT)
         ("+02 * 60"       HAEC)
         ("-10 * 60"       HAST)
         ("+08 * 60"       HKT)
         ("+05 * 60"       HMT)
         ("+07 * 60"       HOVT)
         ("-10 * 60"       HST)
         ("+07 * 60"       ICT)
         ("+03 * 60"       IDT)
         ("+03 * 60"       IOT)
         ("+04 * 60 + 30"  IRDT)
         ("+08 * 60"       IRKT)
         ("+03 * 60 + 30"  IRST)
         ("+09 * 60"       JST)
         ("+06 * 60"       KGT)
         ("+11 * 60"       KOST)
         ("+07 * 60"       KRAT)
         ("+09 * 60"       KST)
         ("+14 * 60"       LINT)
         ("+12 * 60"       MAGT)
         ("-09 * 60 + 30"  MART)
         ("+05 * 60"       MAWT)
         ("-06 * 60"       MDT)
         ("+01 * 60"       MET)
         ("+02 * 60"       MEST)
         ("+12 * 60"       MHT)
         ("+11 * 60"       MIST)
         ("-09 * 60 + 30"  MIT)
         ("+06 * 60 + 30"  MMT)
         ("+03 * 60"       MSK)
         ("+04 * 60"       MUT)
         ("+05 * 60"       MVT)
         ("+08 * 60"       MYT)
         ("+11 * 60"       NCT)
         ("-02 * 60 + 30"  NDT)
         ("+11 * 60 + 30"  NFT)
         ("+05 * 60 + 45"  NPT)
         ("-03 * 60 + 30"  NST)
         ("-03 * 60 + 30"  NT)
         ("-11 * 60"       NUT)
         ("+13 * 60"       NZDT)
         ("+12 * 60"       NZST)
         ("+06 * 60"       OMST)
         ("+05 * 60"       ORAT)
         ("-07 * 60"       PDT)
         ("-05 * 60"       PET)
         ("+12 * 60"       PETT)
         ("+10 * 60"       PGT)
         ("+13 * 60"       PHOT)
         ("+05 * 60"       PKT)
         ("-02 * 60"       PMDT)
         ("-03 * 60"       PMST)
         ("+11 * 60"       PONT)
         ("-03 * 60"       PYST)
         ("-04 * 60"       PYT)
         ("+04 * 60"       RET)
         ("-03 * 60"       ROTT)
         ("+11 * 60"       SAKT)
         ("+04 * 60"       SAMT)
         ("+02 * 60"       SAST)
         ("+11 * 60"       SBT)
         ("+04 * 60"       SCT)
         ("+08 * 60"       SGT)
         ("+05 * 60 + 30"  SLST)
         ("+11 * 60"       SRET)
         ("-03 * 60"       SRT)
         ("+03 * 60"       SYOT)
         ("-10 * 60"       TAHT)
         ("+07 * 60"       THA)
         ("+05 * 60"       TFT)
         ("+05 * 60"       TJT)
         ("+13 * 60"       TKT)
         ("+09 * 60"       TLT)
         ("+05 * 60"       TMT)
         ("+13 * 60"       TOT)
         ("+12 * 60"       TVT)
         ("0"              UCT)
         ("+08 * 60"       ULAT)
         ("+02 * 60"       USZ1)
         ("0"              UTC)
         ("-02 * 60"       UYST)
         ("-03 * 60"       UYT)
         ("+05 * 60"       UZT)
         ("-04 * 60 + 30"  VET)
         ("+10 * 60"       VLAT)
         ("+04 * 60"       VOLT)
         ("+06 * 60"       VOST)
         ("+11 * 60"       VUT)
         ("+12 * 60"       WAKT)
         ("+02 * 60"       WAST)
         ("+01 * 60"       WAT)
         ("+01 * 60"       WEDT)
         ("+01 * 60"       WEST)
         ("0"              WET)
         ("+07 * 60"       WIT)
         ("+08 * 60"       WST)
         ("+09 * 60"       YAKT)
         ("+05 * 60"       YEKT)
         ("0"              Z))))

Modified src/natools-s_expressions-templates-dates.adb from [ef7fabb3a6] to [430a2a1814].

49
50
51
52
53
54
55





56
57
58
59
60
61




62
63
64


















































































65
66
67
68
69
70
71
   function Four_Digit_Image (Value : Integer) return Atom
     is ((1 => Character'Pos ('0') + Octet (Value / 1000),
          2 => Character'Pos ('0') + Octet ((Value / 100) mod 10),
          3 => Character'Pos ('0') + Octet ((Value / 10) mod 10),
          4 => Character'Pos ('0') + Octet (Value mod 10)))
     with Pre => Value in 0 .. 9999;






   procedure Render_Triplet
     (Output : in out Ada.Streams.Root_Stream_Type'Class;
      Part_1, Part_2, Part_3 : in Atom;
      Template : in out Lockable.Descriptor'Class);






   ------------------------------
   -- Local Helper Subprograms --
   ------------------------------



















































































   procedure Render_Triplet
     (Output : in out Ada.Streams.Root_Stream_Type'Class;
      Part_1, Part_2, Part_3 : in Atom;
      Template : in out Lockable.Descriptor'Class) is
   begin
      Output.Write (Part_1);







>
>
>
>
>






>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
   function Four_Digit_Image (Value : Integer) return Atom
     is ((1 => Character'Pos ('0') + Octet (Value / 1000),
          2 => Character'Pos ('0') + Octet ((Value / 100) mod 10),
          3 => Character'Pos ('0') + Octet ((Value / 10) mod 10),
          4 => Character'Pos ('0') + Octet (Value mod 10)))
     with Pre => Value in 0 .. 9999;

   function Parse_Time_Offset
     (Image : in String;
      Date : in Ada.Calendar.Time)
     return Ada.Calendar.Time_Zones.Time_Offset;

   procedure Render_Triplet
     (Output : in out Ada.Streams.Root_Stream_Type'Class;
      Part_1, Part_2, Part_3 : in Atom;
      Template : in out Lockable.Descriptor'Class);


   procedure Interpreter is new Interpreter_Loop
     (Ada.Streams.Root_Stream_Type'Class, Split_Time, Execute, Append);


   ------------------------------
   -- Local Helper Subprograms --
   ------------------------------

   function Parse_Time_Offset
     (Image : in String;
      Date : in Ada.Calendar.Time)
     return Ada.Calendar.Time_Zones.Time_Offset
   is
      function Value (C : Character)
        return Ada.Calendar.Time_Zones.Time_Offset;

      function Value (C : Character)
        return Ada.Calendar.Time_Zones.Time_Offset is
      begin
         if C in '0' .. '9' then
            return Ada.Calendar.Time_Zones.Time_Offset
                    (Character'Pos (C) - Character'Pos ('0'));
         else
            raise Constraint_Error with "Unknown time offset format";
         end if;
      end Value;
   begin
      if Image = "system" then
         return Ada.Calendar.Time_Zones.UTC_Time_Offset (Date);
      end if;

      Abbreviation :
      begin
         return Ada.Calendar.Time_Zones.Time_Offset
           (Static_Maps.S_Expressions.Templates.Dates.To_Time_Offset (Image));
      exception
         when Constraint_Error => null;
      end Abbreviation;

      Numeric :
      declare
         use type Ada.Calendar.Time_Zones.Time_Offset;
         First : Integer := Image'First;
         Length : Natural := Image'Length;
         V : Ada.Calendar.Time_Zones.Time_Offset;
         Negative : Boolean := False;
      begin
         if First in Image'Range and then Image (First) in '-' | '+' then
            Negative := Image (First) = '-';
            First := First + 1;
            Length := Length - 1;
         end if;

         case Length is
            when 1 =>
               V := Value (Image (First)) * 60;

            when 2 =>
               V := Value (Image (First)) * 600
                  + Value (Image (First + 1)) * 60;

            when 4 =>
               V := Value (Image (First)) * 600
                  + Value (Image (First + 1)) * 60
                  + Value (Image (First + 2)) * 10
                  + Value (Image (First + 3));

            when 5 =>
               if Image (First + 2) in '0' .. '9' then
                  raise Constraint_Error with "Unknown time offset format";
               end if;

               V := Value (Image (First)) * 600
                  + Value (Image (First + 1)) * 60
                  + Value (Image (First + 3)) * 10
                  + Value (Image (First + 4));

            when others =>
               raise Constraint_Error with "Unknown time offset format";
         end case;

         if Negative then
            return -V;
         else
            return V;
         end if;
      end Numeric;
   end Parse_Time_Offset;


   procedure Render_Triplet
     (Output : in out Ada.Streams.Root_Stream_Type'Class;
      Part_1, Part_2, Part_3 : in Atom;
      Template : in out Lockable.Descriptor'Class) is
   begin
      Output.Write (Part_1);
211
212
213
214
215
216
217
























218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
         when Commands.RFC_3339 =>
            Output.Write (To_Atom
              (Time_IO.RFC_3339.Image (Value.Source, Value.Time_Zone)));

         when Commands.Second =>
            Format.Set_Image (-1, Null_Atom);
            Integers.Render (Output, Format, Arguments, Value.Second);

























         when Commands.Year =>
            Integers.Render (Output, Arguments, Value.Year);
      end case;
   end Execute;


   procedure Interpreter is new Interpreter_Loop
     (Ada.Streams.Root_Stream_Type'Class, Split_Time, Execute, Append);



   ----------------------
   -- Public Interface --
   ----------------------

   function Split







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






<
<
<
<







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338




339
340
341
342
343
344
345
         when Commands.RFC_3339 =>
            Output.Write (To_Atom
              (Time_IO.RFC_3339.Image (Value.Source, Value.Time_Zone)));

         when Commands.Second =>
            Format.Set_Image (-1, Null_Atom);
            Integers.Render (Output, Format, Arguments, Value.Second);

         when Commands.With_Offset =>
            if Arguments.Current_Event = Events.Add_Atom then
               declare
                  use type Ada.Calendar.Time_Zones.Time_Offset;
                  New_Offset : Ada.Calendar.Time_Zones.Time_Offset;
               begin
                  begin
                     New_Offset := Parse_Time_Offset
                       (S_Expressions.To_String (Arguments.Current_Atom),
                        Value.Source);
                  exception
                     when Constraint_Error => return;
                  end;

                  Arguments.Next;

                  if New_Offset = Value.Time_Zone then
                     Interpreter (Arguments, Output, Value);
                  else
                     Render (Output, Arguments, Value.Source, New_Offset);
                  end if;
               end;
            end if;

         when Commands.Year =>
            Integers.Render (Output, Arguments, Value.Year);
      end case;
   end Execute;







   ----------------------
   -- Public Interface --
   ----------------------

   function Split