Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit d63e833

Browse files
committed
Addressed the minor review comments on merged PR #143.
1 parent e9f4732 commit d63e833

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

proposals/exception-handling/Exceptions-formal-overview.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ mod ::= 'module' ... tag*
3636

3737
## Validation (Typing)
3838

39-
#### Modification to Labels
39+
40+
### Validation Contexts: Tagtypes and modified Labels
4041

4142
To verify that the `rethrow l` instruction refers to a label surrounding the instructions of a catch block (call this a catch-label), we introduce a `kind` attribute to labels in the validation context, which is set to `catch` when the label is a catch-label and empty otherwise.
4243

4344
```
4445
labelkind ::= 'catch'
4546
labeltype ::= 'catch'? resulttype
46-
C ::= {..., 'labels' labeltype}
4747
```
4848

4949
The original notation `labels [t*]` is now an abbreviation for:
@@ -52,11 +52,11 @@ The original notation `labels [t*]` is now an abbreviation for:
5252
'labels' [t*] ::= 'labels' ε [t*]
5353
```
5454

55-
### Validation Contexts
55+
The `labels` entry of validation contexts is modified to use the above definition of labels.
56+
Moreover, validation contexts now hold a list of tag types, one for each tag known to them.
5657

57-
Validation contexts now hold a list of tag types, one for each tag known to them.
5858
```
59-
C ::= { ..., 'tags' tagtype*}
59+
C ::= { ..., 'labels' labeltype, 'tags' tagtype*}
6060
```
6161

6262
### Validation Rules for Instructions
@@ -76,8 +76,8 @@ C ⊢ rethrow l : [t1*]→[t2*]
7676
C ⊢ bt : [t1*]→[t2*]
7777
C, labels [t2*] ⊢ instr* : [t1*]→[t2*]
7878
(C.tags[x] = [t*]→[] ∧
79-
C, labels catch [t2*] ⊢ instr'* : [t*]→[t2*])*
80-
(C, labels catch [t2*] ⊢ instr''* : []→[t2*])?
79+
C, labels (catch [t2*]) ⊢ instr'* : [t*]→[t2*])*
80+
(C, labels (catch [t2*]) ⊢ instr''* : []→[t2*])?
8181
-----------------------------------------------------------------------------
8282
C ⊢ try bt instr* (catch x instr'*)* (catch_all instr''*)? end : [t1*]→[t2*]
8383
@@ -200,7 +200,7 @@ S.tags[a].type = [t*]→[]
200200
S;C ⊢ throw a : [t1* t*]→[t2*]
201201
202202
((S.tags[a].type = [t'*]→[])?
203-
S;C, labels catch [t*] ⊢ instr'* : [t'*?]→[t*])*
203+
S;C, labels (catch [t*]) ⊢ instr'* : [t'*?]→[t*])*
204204
S;C, labels [t*] ⊢ instr* : []→[t*]
205205
-----------------------------------------------------------
206206
S;C, labels [t*] ⊢ catch{a? instr'*}* instr* end : []→[t*]
@@ -212,7 +212,7 @@ S;C, labels [t*] ⊢ delegate{l} instr* end : []→[t*]
212212
213213
S.tags[a].type = [t'*]→[]
214214
(val:t')*
215-
S;C, labels catch [t*] ⊢ instr* : []→[t*]
215+
S;C, labels (catch [t*]) ⊢ instr* : []→[t*]
216216
----------------------------------------------------------
217217
S;C, labels [t*] ⊢ caught{a val^n} instr* end : []→[t*]
218218
```

0 commit comments

Comments
 (0)