@@ -210,31 +210,33 @@ The subsequent definitions of loading and storing a value from linear memory
210
210
require additional context, which is threaded through most subsequent
211
211
definitions via the ` cx ` parameter:
212
212
``` 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
213
221
class CanonicalOptions :
214
222
memory: bytearray
215
223
string_encoding: str
216
224
realloc: Callable[[int ,int ,int ,int ],int ]
217
225
post_return: Callable[[],None ]
226
+ ```
218
227
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
219
235
class ComponentInstance :
220
236
may_leave = True
221
237
may_enter = True
222
238
# ...
223
-
224
- class Context :
225
- opts: CanonicalOptions
226
- inst: ComponentInstance
227
239
```
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.
238
240
239
241
240
242
### Loading
0 commit comments