19
19
-- program; see the files COPYING3 and COPYING.RUNTIME respectively.
20
20
-- If not, see <http://www.gnu.org/licenses/>.
21
21
22
- -- with Ada.Strings.Unbounded;
23
- -- private with Ada.Finalization;
24
- -- private with Analytical_Engine.Mill;
25
- -- private with Analytical_Engine.Store;
26
- -- private with GNATCOLL.GMP.Integers;
27
- -- private with System;
28
-
29
- -- with Ada.Strings.Fixed;
22
+ with Ada.Characters.Conversions ;
23
+ with Ada.Strings.Wide_Unbounded ;
24
+
30
25
with Analytical_Engine.Framework ;
26
+
31
27
with GNAT.Regpat ;
32
28
33
29
package body Analytical_Engine.Card.Attendant_Request is
@@ -50,44 +46,45 @@ package body Analytical_Engine.Card.Attendant_Request is
50
46
51
47
Max_Parens : constant := 10 ; -- overkill
52
48
53
- function Read (From : String) return Card'Class is
54
- -- First : Positive;
55
- -- Last : Natural;
49
+ function "+" (Item : Wide_String) return String
50
+ is (Ada.Characters.Conversions.To_String (Item, Substitute => ' ' ));
51
+
52
+ function Read (From : Wide_String) return Card'Class is
56
53
Matches : GNAT.Regpat.Match_Array (0 .. Max_Parens);
57
54
use type GNAT.Regpat.Match_Location;
58
55
begin
59
- GNAT.Regpat.Match (Picture_Matcher, From, Matches);
56
+ GNAT.Regpat.Match (Picture_Matcher, + From, Matches);
60
57
if Matches (0 ) /= GNAT.Regpat.No_Match then
61
58
return C : Picture_Card do
62
- C.Source := Ada.Strings.Unbounded.To_Unbounded_String (From);
59
+ C.Source := To_Unbounded_Wide_String (From);
63
60
C.Picture :=
64
- Ada.Strings.Unbounded.To_Unbounded_String
61
+ To_Unbounded_Wide_String
65
62
(From (Matches (1 ).First .. Matches (1 ).Last));
66
63
end return ;
67
64
end if ;
68
65
69
- GNAT.Regpat.Match (Row_Column_Matcher, From, Matches);
66
+ GNAT.Regpat.Match (Row_Column_Matcher, + From, Matches);
70
67
if Matches (0 ) /= GNAT.Regpat.No_Match then
71
68
return C : Row_Column_Card do
72
- C.Source := Ada.Strings.Unbounded.To_Unbounded_String (From);
69
+ C.Source := To_Unbounded_Wide_String (From);
73
70
C.In_Rows := From (Matches (1 ).First .. Matches (1 ).Last) = " rows" ;
74
71
end return ;
75
72
end if ;
76
73
77
- GNAT.Regpat.Match (Annotation_Matcher, From, Matches);
74
+ GNAT.Regpat.Match (Annotation_Matcher, + From, Matches);
78
75
if Matches (0 ) /= GNAT.Regpat.No_Match then
79
76
return C : Annotation_Card do
80
- C.Source := Ada.Strings.Unbounded.To_Unbounded_String (From);
77
+ C.Source := To_Unbounded_Wide_String (From);
81
78
C.Annotation :=
82
- Ada.Strings.Unbounded.To_Unbounded_String
79
+ To_Unbounded_Wide_String
83
80
(From (Matches (1 ).First .. Matches (1 ).Last));
84
81
end return ;
85
82
end if ;
86
83
87
- GNAT.Regpat.Match (New_Line_Matcher, From, Matches);
84
+ GNAT.Regpat.Match (New_Line_Matcher, + From, Matches);
88
85
if Matches (0 ) /= GNAT.Regpat.No_Match then
89
86
return C : New_Line_Card do
90
- C.Source := Ada.Strings.Unbounded.To_Unbounded_String (From);
87
+ C.Source := To_Unbounded_Wide_String (From);
91
88
end return ;
92
89
end if ;
93
90
raise Card_Error
@@ -119,14 +116,15 @@ package body Analytical_Engine.Card.Attendant_Request is
119
116
procedure Execute (C : Annotation_Card;
120
117
In_The_Framework : in out Framework.Instance) is
121
118
begin
122
- In_The_Framework.Output.Output (To_String (C.Annotation));
119
+ In_The_Framework.Output.Output (To_Wide_String (C.Annotation));
123
120
end Execute ;
124
121
125
122
procedure Execute (C : New_Line_Card;
126
123
In_The_Framework : in out Framework.Instance) is
127
124
pragma Unreferenced (C);
125
+ use Ada.Characters.Conversions;
128
126
begin
129
- In_The_Framework.Output.Output ((1 => ASCII.LF));
127
+ In_The_Framework.Output.Output ((1 => To_Wide_Character ( ASCII.LF) ));
130
128
end Execute ;
131
129
132
130
-- Not_A_Request);
0 commit comments