@@ -210,31 +210,33 @@ The subsequent definitions of loading and storing a value from linear memory
210210require additional context, which is threaded through most subsequent
211211definitions via the ` cx ` parameter:
212212``` python
213+ class Context :
214+ opts: CanonicalOptions
215+ inst: ComponentInstance
216+ ```
217+
218+ The ` opts ` field represents the [ ` canonopt ` ] values supplied to
219+ currently-executing ` canon lift ` or ` canon lower ` :
220+ ``` python
213221class CanonicalOptions :
214222 memory: bytearray
215223 string_encoding: str
216224 realloc: Callable[[int ,int ,int ,int ],int ]
217225 post_return: Callable[[],None ]
226+ ```
218227
228+ The ` inst ` field represents the component instance that the currently-executing
229+ canonical definition is defined to execute inside. The ` may_enter ` and
230+ ` may_leave ` fields are used to enforce the [ component invariants] : ` may_leave `
231+ indicates whether the instance may call out to an import and the ` may_enter `
232+ state indicates whether the instance may be called from the outside world
233+ through an export.
234+ ``` python
219235class ComponentInstance :
220236 may_leave = True
221237 may_enter = True
222238 # ...
223-
224- class Context :
225- opts: CanonicalOptions
226- inst: ComponentInstance
227239```
228- Going through the fields of ` Context ` :
229-
230- The ` opts ` field represents the [ ` canonopt ` ] values supplied to
231- currently-executing ` canon lift ` or ` canon lower ` .
232-
233- The ` inst ` field represents the component instance that the currently-executing
234- canonical definition is closed over. The ` may_enter ` and ` may_leave ` fields are
235- used to enforce the [ component invariants] : ` may_leave ` indicates whether the
236- instance may call out to an import and the ` may_enter ` state indicates whether
237- the instance may be called from the outside world through an export.
238240
239241
240242### Loading
0 commit comments