Skip to content

Commit fbf6d5e

Browse files
frank-at-adacoreJulienBerkane
authored andcommitted
Fix truncated text
1 parent e286b72 commit fbf6d5e

2 files changed

Lines changed: 38 additions & 44 deletions

File tree

courses/ada_essentials/190_exceptions/02-handlers.rst

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -197,53 +197,45 @@ Exception Handler Content
197197
Quiz
198198
------
199199

200-
.. container:: latex_environment scriptsize
201-
202-
.. container:: columns
203-
204-
.. container:: column
205-
206-
.. code:: Ada
207-
:number-lines: 1
208-
209-
procedure Main is
210-
A, B, C, D : Integer range 0 .. 100;
211-
begin
212-
A := 1; B := 2; C := 3; D := 4;
213-
begin
214-
D := A - C + B;
215-
exception
216-
when others => Put_Line ("One");
217-
D := 1;
218-
end;
219-
D := D + 1;
220-
begin
221-
D := D / (A - C + B);
222-
exception
223-
when others => Put_Line ("Two");
224-
D := -1;
225-
end;
226-
exception
227-
when others =>
228-
Put_Line ("Three");
229-
end Main;
230-
231-
.. container:: column
200+
.. code:: Ada
201+
:number-lines: 1
202+
:font-size: footnotesize
232203
233-
What will get printed?
204+
procedure Main is
205+
A, B, C, D : Integer range 0 .. 100;
206+
begin
207+
A := 1; B := 2; C := 3; D := 4;
208+
begin
209+
D := A - C + B;
210+
exception
211+
when others => Put_Line ("One");
212+
D := 1;
213+
end;
214+
D := D + 1;
215+
begin
216+
D := D / (A - C + B);
217+
exception
218+
when others => Put_Line ("Two");
219+
D := -1;
220+
end;
221+
exception
222+
when others =>
223+
Put_Line ("Three");
224+
end Main;
234225
235-
A. One, Two, Three
236-
B. :answer:`Two, Three`
237-
C. Two
238-
D. Three
226+
What will get printed?
239227

240-
.. container:: animate
228+
A. One, Two, Three
229+
B. :answer:`Two, Three`
230+
C. Two
231+
D. Three
241232

242-
Explanations
233+
.. container:: animate
243234

244-
A. :ada:`One` is never printed, as although :ada:`(A - C)` is not in the range of :ada:`0 .. 100`, this is only checked on assignment (so after the addition of :ada:`B`).
245-
B. Line 6 does not raise an exception, (so ``One`` is not printed), but Line 2 does - causing ``Two`` to be printed.
246-
But Line 16 also raises an exception, causing ``Three`` to be printed
247-
C. If we reach :ada:`Two`, the assignment on line 16 will cause :ada:`Three` to be reached
248-
D. Divide by 0 on line 13 causes an exception, so :ada:`Two` must be called
235+
Explanations
249236

237+
A. :ada:`One` is never printed. Although :ada:`(A - C)` is not in range, this is only checked on assignment (after addition of :ada:`B`).
238+
B. No exception on Line 6 (``One`` is not printed), but Line 2 does - so ``Two`` to be printed.
239+
Line 16 also raises an exception, so ``Three`` to be printed.
240+
C. If we reach :ada:`Two`, line 16 will cause :ada:`Three` to be reached
241+
D. Divide by 0 on line 13 causes an exception, so :ada:`Two` must be called

courses/ada_essentials/190_exceptions/06-propagation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Propagation Demo
3636

3737
.. code:: Ada
3838
:number-lines: 1
39+
:font-size: small
3940
4041
procedure Do_Something is
4142
Error : exception;
@@ -56,6 +57,7 @@ Propagation Demo
5657

5758
.. code:: Ada
5859
:number-lines: 16
60+
:font-size: small
5961
6062
begin -- Do_Something
6163
Maybe_Raise (3);

0 commit comments

Comments
 (0)