@@ -41,17 +41,17 @@ class CoreExportDecl:
41
41
42
42
@dataclass
43
43
class ModuleType (ExternType ):
44
- imports : [CoreImportDecl ]
45
- exports : [CoreExportDecl ]
44
+ imports : list [CoreImportDecl ]
45
+ exports : list [CoreExportDecl ]
46
46
47
47
@dataclass
48
48
class CoreFuncType (CoreExternType ):
49
- params : [str ]
50
- results : [str ]
49
+ params : list [str ]
50
+ results : list [str ]
51
51
52
52
@dataclass
53
53
class CoreMemoryType (CoreExternType ):
54
- initial : [int ]
54
+ initial : list [int ]
55
55
maximum : Optional [int ]
56
56
57
57
@dataclass
@@ -61,17 +61,17 @@ class ExternDecl:
61
61
62
62
@dataclass
63
63
class ComponentType (ExternType ):
64
- imports : [ExternDecl ]
65
- exports : [ExternDecl ]
64
+ imports : list [ExternDecl ]
65
+ exports : list [ExternDecl ]
66
66
67
67
@dataclass
68
68
class InstanceType (ExternType ):
69
- exports : [ExternDecl ]
69
+ exports : list [ExternDecl ]
70
70
71
71
@dataclass
72
72
class FuncType (ExternType ):
73
- params : [ typing . Tuple [str ,ValType ]]
74
- results : [ValType | typing . Tuple [str ,ValType ]]
73
+ params : list [ tuple [str ,ValType ]]
74
+ results : list [ValType | tuple [str ,ValType ]]
75
75
def param_types (self ):
76
76
return self .extract_types (self .params )
77
77
def result_types (self ):
@@ -122,25 +122,25 @@ class Field:
122
122
123
123
@dataclass
124
124
class Record (ValType ):
125
- fields : [Field ]
125
+ fields : list [Field ]
126
126
127
127
@dataclass
128
128
class Tuple (ValType ):
129
- ts : [ValType ]
129
+ ts : list [ValType ]
130
130
131
131
@dataclass
132
132
class Case :
133
133
label : str
134
134
t : Optional [ValType ]
135
- refines : str = None
135
+ refines : Optional [ str ] = None
136
136
137
137
@dataclass
138
138
class Variant (ValType ):
139
- cases : [Case ]
139
+ cases : list [Case ]
140
140
141
141
@dataclass
142
142
class Enum (ValType ):
143
- labels : [str ]
143
+ labels : list [str ]
144
144
145
145
@dataclass
146
146
class Option (ValType ):
@@ -153,7 +153,7 @@ class Result(ValType):
153
153
154
154
@dataclass
155
155
class Flags (ValType ):
156
- labels : [str ]
156
+ labels : list [str ]
157
157
158
158
@dataclass
159
159
class Own (ValType ):
@@ -276,7 +276,7 @@ def num_i32_flags(labels):
276
276
class CallContext :
277
277
opts : CanonicalOptions
278
278
inst : ComponentInstance
279
- lenders : [HandleElem ]
279
+ lenders : list [HandleElem ]
280
280
borrow_count : int
281
281
282
282
def __init__ (self , opts , inst ):
@@ -332,8 +332,8 @@ def __init__(self, rep, own, scope = None):
332
332
self .lend_count = 0
333
333
334
334
class HandleTable :
335
- array : [Optional [HandleElem ]]
336
- free : [int ]
335
+ array : list [Optional [HandleElem ]]
336
+ free : list [int ]
337
337
338
338
def __init__ (self ):
339
339
self .array = [None ]
@@ -402,8 +402,8 @@ def load(cx, ptr, t):
402
402
case Record (fields ) : return load_record (cx , ptr , fields )
403
403
case Variant (cases ) : return load_variant (cx , ptr , cases )
404
404
case Flags (labels ) : return load_flags (cx , ptr , labels )
405
- case Own () : return lift_own (cx , load_int (opts , ptr , 4 ), t )
406
- case Borrow () : return lift_borrow (cx , load_int (opts , ptr , 4 ), t )
405
+ case Own () : return lift_own (cx , load_int (cx . opts , ptr , 4 ), t )
406
+ case Borrow () : return lift_borrow (cx , load_int (cx . opts , ptr , 4 ), t )
407
407
408
408
def load_int (cx , ptr , nbytes , signed = False ):
409
409
return int .from_bytes (cx .opts .memory [ptr : ptr + nbytes ], 'little' , signed = signed )
@@ -573,8 +573,8 @@ def store(cx, v, t, ptr):
573
573
case Record (fields ) : store_record (cx , v , ptr , fields )
574
574
case Variant (cases ) : store_variant (cx , v , ptr , cases )
575
575
case Flags (labels ) : store_flags (cx , v , ptr , labels )
576
- case Own () : store_int (cx , lower_own (opts , v , t ), ptr , 4 )
577
- case Borrow () : store_int (cx , lower_borrow (opts , v , t ), ptr , 4 )
576
+ case Own () : store_int (cx , lower_own (cx . opts , v , t ), ptr , 4 )
577
+ case Borrow () : store_int (cx , lower_borrow (cx . opts , v , t ), ptr , 4 )
578
578
579
579
def store_int (cx , v , ptr , nbytes , signed = False ):
580
580
cx .opts .memory [ptr : ptr + nbytes ] = int .to_bytes (v , nbytes , 'little' , signed = signed )
@@ -897,7 +897,7 @@ class Value:
897
897
898
898
@dataclass
899
899
class ValueIter :
900
- values : [Value ]
900
+ values : list [Value ]
901
901
i = 0
902
902
def next (self , t ):
903
903
v = self .values [self .i ]
0 commit comments