Skip to content

Commit 24f0819

Browse files
authored
Fix throwref execution prose (#330)
1 parent 79323b5 commit 24f0819

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

document/core/exec/instructions.rst

+23-23
Original file line numberDiff line numberDiff line change
@@ -2757,75 +2757,75 @@ Control Instructions
27572757
:math:`\THROWREF`
27582758
.................
27592759

2760-
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
2761-
2762-
2. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
2760+
1. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
27632761

2764-
3. Pop the reference :math:`\reff` from the stack.
2762+
2. Pop the reference :math:`\reff` from the stack.
27652763

2766-
4. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
2764+
3. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
27672765

27682766
a. Trap.
27692767

2770-
5. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn-addr>`.
2768+
4. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn-addr>`.
27712769

2772-
6. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
2770+
5. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
27732771

2774-
7. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
2772+
6. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
27752773

2776-
8. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
2774+
7. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
27772775

2778-
9. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
2776+
8. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
27792777

2780-
10. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
2778+
9. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
27812779

27822780
a. Pop the top element from the stack.
27832781

2784-
11. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
2782+
10. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
27852783

2786-
12. If the stack is empty, then:
2784+
11. If the stack is empty, then:
27872785

27882786
a. Return the exception :math:`(\REFEXNADDR~a)` as a :ref:`result <syntax-result>`.
27892787

2790-
13. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
2788+
12. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
27912789

2792-
14. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
2790+
13. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
27932791

2794-
15. If :math:`\catch^\ast` is empty, then:
2792+
14. If :math:`\catch^\ast` is empty, then:
27952793

27962794
a. Push the exception reference :math:`\REFEXNADDR~\X{ea}` back to the stack.
27972795

27982796
b. Execute the instruction |THROWREF| again.
27992797

2800-
16. Else:
2798+
15. Else:
2799+
2800+
a. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
28012801

2802-
a. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
2802+
b. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
28032803

2804-
b. If :math:`\catch_1` is of the form :math:`\CATCH~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2804+
c. If :math:`\catch_1` is of the form :math:`\CATCH~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
28052805

28062806
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
28072807

28082808
ii. Execute the instruction :math:`\BR~l`.
28092809

2810-
c. Else if :math:`\catch_1` is of the form :math:`\CATCHREF~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2810+
d. Else if :math:`\catch_1` is of the form :math:`\CATCHREF~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
28112811

28122812
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
28132813

28142814
ii. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
28152815

28162816
iii. Execute the instruction :math:`\BR~l`.
28172817

2818-
d. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
2818+
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
28192819

28202820
i. Execute the instruction :math:`\BR~l`.
28212821

2822-
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
2822+
f. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
28232823

28242824
i. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
28252825

28262826
ii. Execute the instruction :math:`\BR~l`.
28272827

2828-
f. Else:
2828+
g. Else:
28292829

28302830
1. Push the modified handler :math:`\HANDLER_n\{{\catch'}^\ast\}` back to the stack.
28312831

0 commit comments

Comments
 (0)