wardite 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/break.wat +13 -0
- data/examples/call_indirect.wat +15 -0
- data/examples/global.wat +13 -0
- data/examples/loop.wat +20 -0
- data/examples/start.wat +12 -0
- data/lib/wardite/instruction.rb +12 -6
- data/lib/wardite/load.rb +800 -0
- data/lib/wardite/value.rb +45 -42
- data/lib/wardite/version.rb +1 -1
- data/lib/wardite/wasi.rb +2 -2
- data/lib/wardite.rb +465 -605
- data/sig/generated/wardite/instruction.rbs +8 -5
- data/sig/generated/wardite/load.rbs +236 -0
- data/sig/generated/wardite/value.rbs +82 -80
- data/sig/generated/wardite/wasi.rbs +4 -4
- data/sig/generated/wardite.rbs +120 -181
- data/sig/wardite.rbs +1 -3
- metadata +9 -2
@@ -1,6 +1,8 @@
|
|
1
1
|
# Generated from lib/wardite/instruction.rb with RBS::Inline
|
2
2
|
|
3
3
|
module Wardite
|
4
|
+
type operandItem = Integer | Array[Integer] | Float | Block
|
5
|
+
|
4
6
|
class Op
|
5
7
|
# @see https://pengowray.github.io/wasm-ops/
|
6
8
|
SYMS: Array[Symbol]
|
@@ -13,22 +15,23 @@ module Wardite
|
|
13
15
|
attr_accessor code: Symbol
|
14
16
|
|
15
17
|
# TODO: add types of potential operands
|
16
|
-
attr_accessor operand: Array[
|
18
|
+
attr_accessor operand: Array[operandItem]
|
17
19
|
|
18
20
|
# @rbs namespace: Symbol
|
19
21
|
# @rbs code: Symbol
|
20
|
-
# @rbs operand: Array[
|
21
|
-
def initialize: (Symbol namespace, Symbol code, Array[
|
22
|
+
# @rbs operand: Array[operandItem]
|
23
|
+
def initialize: (Symbol namespace, Symbol code, Array[operandItem] operand) -> untyped
|
22
24
|
|
23
25
|
# @rbs chr: String
|
24
26
|
# @rbs return: [Symbol, Symbol]
|
25
27
|
def self.to_sym: (String chr) -> [ Symbol, Symbol ]
|
26
28
|
|
27
|
-
# @rbs
|
29
|
+
# @rbs code: Symbol
|
28
30
|
# @rbs return: Array[Symbol]
|
29
|
-
def self.operand_of: (
|
31
|
+
def self.operand_of: (Symbol code) -> Array[Symbol]
|
30
32
|
|
31
33
|
# @see https://www.w3.org/TR/wasm-core-1/#value-types%E2%91%A2
|
34
|
+
# We use this for reftype conversion. https://webassembly.github.io/spec/core/binary/types.html#binary-reftype
|
32
35
|
# @rbs code: Integer
|
33
36
|
# @rbs return: Symbol
|
34
37
|
def self.i2type: (Integer code) -> Symbol
|
@@ -0,0 +1,236 @@
|
|
1
|
+
# Generated from lib/wardite/load.rb with RBS::Inline
|
2
|
+
|
3
|
+
# rbs_inline: enabled
|
4
|
+
module Wardite
|
5
|
+
class Section
|
6
|
+
attr_accessor name: String
|
7
|
+
|
8
|
+
attr_accessor code: Integer
|
9
|
+
|
10
|
+
attr_accessor size: Integer
|
11
|
+
end
|
12
|
+
|
13
|
+
class TypeSection < Section
|
14
|
+
attr_accessor defined_types: Array[Array[Symbol]]
|
15
|
+
|
16
|
+
attr_accessor defined_results: Array[Array[Symbol]]
|
17
|
+
|
18
|
+
# @rbs return: void
|
19
|
+
def initialize: () -> void
|
20
|
+
end
|
21
|
+
|
22
|
+
class FunctionSection < Section
|
23
|
+
attr_accessor func_indices: Array[Integer]
|
24
|
+
|
25
|
+
# @rbs return: void
|
26
|
+
def initialize: () -> void
|
27
|
+
end
|
28
|
+
|
29
|
+
class TableSection < Section
|
30
|
+
attr_accessor table_types: Array[Symbol]
|
31
|
+
|
32
|
+
attr_accessor table_limits: Array[[ Integer, Integer? ]]
|
33
|
+
|
34
|
+
# @rbs return: void
|
35
|
+
def initialize: () -> void
|
36
|
+
end
|
37
|
+
|
38
|
+
class MemorySection < Section
|
39
|
+
attr_accessor limits: Array[[ Integer, Integer? ]]
|
40
|
+
|
41
|
+
# @rbs return: void
|
42
|
+
def initialize: () -> void
|
43
|
+
end
|
44
|
+
|
45
|
+
class GlobalSection < Section
|
46
|
+
class Global
|
47
|
+
attr_accessor type: Symbol
|
48
|
+
|
49
|
+
attr_accessor mutable: bool
|
50
|
+
|
51
|
+
# TODO: unused in wasm 1.0 spec?
|
52
|
+
attr_accessor shared: bool
|
53
|
+
|
54
|
+
attr_accessor value: wasmValue
|
55
|
+
|
56
|
+
# @rbs &blk: (Global) -> void
|
57
|
+
# @rbs return: void
|
58
|
+
def initialize: () { (Global) -> void } -> void
|
59
|
+
end
|
60
|
+
|
61
|
+
attr_accessor globals: Array[Global]
|
62
|
+
|
63
|
+
# @rbs return: void
|
64
|
+
def initialize: () -> void
|
65
|
+
end
|
66
|
+
|
67
|
+
class StartSection < Section
|
68
|
+
attr_accessor func_index: Integer
|
69
|
+
|
70
|
+
# @rbs return: void
|
71
|
+
def initialize: () -> void
|
72
|
+
end
|
73
|
+
|
74
|
+
class ElemSection < Section
|
75
|
+
attr_accessor table_indices: Array[Integer]
|
76
|
+
|
77
|
+
attr_accessor table_offsets: Array[Integer]
|
78
|
+
|
79
|
+
attr_accessor element_indices: Array[Array[Integer]]
|
80
|
+
|
81
|
+
# @rbs return: void
|
82
|
+
def initialize: () -> void
|
83
|
+
end
|
84
|
+
|
85
|
+
class CodeSection < Section
|
86
|
+
class CodeBody
|
87
|
+
attr_accessor locals_count: Array[Integer]
|
88
|
+
|
89
|
+
attr_accessor locals_type: Array[Symbol]
|
90
|
+
|
91
|
+
attr_accessor body: Array[Op]
|
92
|
+
|
93
|
+
# @rbs &blk: (CodeBody) -> void
|
94
|
+
# @rbs return: void
|
95
|
+
def initialize: () { (CodeBody) -> void } -> void
|
96
|
+
end
|
97
|
+
|
98
|
+
attr_accessor func_codes: Array[CodeBody]
|
99
|
+
|
100
|
+
# @rbs return: void
|
101
|
+
def initialize: () -> void
|
102
|
+
end
|
103
|
+
|
104
|
+
class DataSection < Section
|
105
|
+
class Segment
|
106
|
+
attr_accessor flags: Integer
|
107
|
+
|
108
|
+
attr_accessor offset: Integer
|
109
|
+
|
110
|
+
attr_accessor data: String
|
111
|
+
|
112
|
+
# @rbs &blk: (Segment) -> void
|
113
|
+
# @rbs return: void
|
114
|
+
def initialize: () { (Segment) -> void } -> void
|
115
|
+
end
|
116
|
+
|
117
|
+
attr_accessor segments: Array[Segment]
|
118
|
+
|
119
|
+
# @rbs return: void
|
120
|
+
def initialize: () -> void
|
121
|
+
end
|
122
|
+
|
123
|
+
class ExportSection < Section
|
124
|
+
class ExportDesc
|
125
|
+
attr_accessor name: String
|
126
|
+
|
127
|
+
attr_accessor kind: Integer
|
128
|
+
|
129
|
+
attr_accessor func_index: Integer
|
130
|
+
end
|
131
|
+
|
132
|
+
attr_accessor exports: Hash[String, ExportDesc]
|
133
|
+
|
134
|
+
def initialize: () -> void
|
135
|
+
|
136
|
+
# @rbs &blk: (ExportDesc) -> void
|
137
|
+
def add_desc: () { (ExportDesc) -> void } -> untyped
|
138
|
+
end
|
139
|
+
|
140
|
+
class ImportSection < Section
|
141
|
+
class ImportDesc
|
142
|
+
attr_accessor module_name: String
|
143
|
+
|
144
|
+
attr_accessor name: String
|
145
|
+
|
146
|
+
attr_accessor kind: Integer
|
147
|
+
|
148
|
+
attr_accessor sig_index: Integer
|
149
|
+
end
|
150
|
+
|
151
|
+
attr_accessor imports: Array[ImportDesc]
|
152
|
+
|
153
|
+
def initialize: () -> void
|
154
|
+
|
155
|
+
# @rbs &blk: (ImportDesc) -> void
|
156
|
+
def add_desc: () { (ImportDesc) -> void } -> untyped
|
157
|
+
end
|
158
|
+
|
159
|
+
module BinaryLoader
|
160
|
+
extend Wardite::Leb128Helper
|
161
|
+
|
162
|
+
extend Wardite::ValueHelper
|
163
|
+
|
164
|
+
self.@buf: File | StringIO
|
165
|
+
|
166
|
+
# @rbs buf: File|StringIO
|
167
|
+
# @rbs import_object: Hash[Symbol, Hash[Symbol, wasmCallable]]
|
168
|
+
# @rbs enable_wasi: boolish
|
169
|
+
# @rbs return: Instance
|
170
|
+
def self.load_from_buffer: (File | StringIO buf, ?import_object: Hash[Symbol, Hash[Symbol, wasmCallable]], ?enable_wasi: boolish) -> Instance
|
171
|
+
|
172
|
+
# @rbs return: Integer
|
173
|
+
def self.preamble: () -> Integer
|
174
|
+
|
175
|
+
# @rbs return: Array[Section]
|
176
|
+
def self.sections: () -> Array[Section]
|
177
|
+
|
178
|
+
# @rbs return: TypeSection
|
179
|
+
def self.type_section: () -> TypeSection
|
180
|
+
|
181
|
+
# @rbs return: ImportSection
|
182
|
+
def self.import_section: () -> ImportSection
|
183
|
+
|
184
|
+
# @rbs return: MemorySection
|
185
|
+
def self.memory_section: () -> MemorySection
|
186
|
+
|
187
|
+
# @rbs return: StartSection
|
188
|
+
def self.start_section: () -> StartSection
|
189
|
+
|
190
|
+
# @rbs return: ElemSection
|
191
|
+
def self.elem_section: () -> ElemSection
|
192
|
+
|
193
|
+
# @rbs return: GlobalSection
|
194
|
+
def self.global_section: () -> GlobalSection
|
195
|
+
|
196
|
+
# @rbs return: FunctionSection
|
197
|
+
def self.function_section: () -> FunctionSection
|
198
|
+
|
199
|
+
# @rbs return: TableSection
|
200
|
+
def self.table_section: () -> TableSection
|
201
|
+
|
202
|
+
# @rbs return: CodeSection
|
203
|
+
def self.code_section: () -> CodeSection
|
204
|
+
|
205
|
+
# @rbs buf: StringIO
|
206
|
+
# @rbs return: Array[::Wardite::Op]
|
207
|
+
def self.code_body: (StringIO buf) -> Array[::Wardite::Op]
|
208
|
+
|
209
|
+
# @rbs return: DataSection
|
210
|
+
def self.data_section: () -> DataSection
|
211
|
+
|
212
|
+
# @rbs sbuf: StringIO
|
213
|
+
# @rbs return: String
|
214
|
+
def self.fetch_insn_while_end: (StringIO sbuf) -> String
|
215
|
+
|
216
|
+
# @rbs ops: Array[Op]
|
217
|
+
# @rbs return: Integer
|
218
|
+
def self.decode_expr: (Array[Op] ops) -> Integer
|
219
|
+
|
220
|
+
# @rbs ops: Array[Op]
|
221
|
+
# @rbs return: wasmValue
|
222
|
+
def self.decode_global_expr: (Array[Op] ops) -> wasmValue
|
223
|
+
|
224
|
+
# @rbs return: ExportSection
|
225
|
+
def self.export_section: () -> ExportSection
|
226
|
+
|
227
|
+
# @rbs code: Integer
|
228
|
+
# @rbs return: nil
|
229
|
+
def self.unimplemented_skip_section: (Integer code) -> nil
|
230
|
+
|
231
|
+
# @rbs sbuf: StringIO
|
232
|
+
# @rbs n: Integer
|
233
|
+
# @rbs return: String
|
234
|
+
def self.assert_read: (StringIO sbuf, Integer n) -> String
|
235
|
+
end
|
236
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# Generated from lib/wardite/value.rb with RBS::Inline
|
2
2
|
|
3
3
|
module Wardite
|
4
|
+
type wasmValue = I32 | I64 | F32 | F64
|
5
|
+
|
4
6
|
module ValueHelper
|
5
7
|
# @rbs value: Integer
|
6
8
|
# @rbs return: I32
|
@@ -59,44 +61,44 @@ module Wardite
|
|
59
61
|
def packed: (?size: Integer | nil) -> String
|
60
62
|
|
61
63
|
# @rbs to: Symbol
|
62
|
-
# @rbs return:
|
63
|
-
def wrap: (to: Symbol) ->
|
64
|
+
# @rbs return: wasmValue
|
65
|
+
def wrap: (to: Symbol) -> wasmValue
|
64
66
|
|
65
67
|
# @rbs to: Symbol
|
66
|
-
# @rbs return:
|
67
|
-
def extend_s: (to: Symbol) ->
|
68
|
+
# @rbs return: wasmValue
|
69
|
+
def extend_s: (to: Symbol) -> wasmValue
|
68
70
|
|
69
71
|
# @rbs to: Symbol
|
70
|
-
# @rbs return:
|
71
|
-
def extend_u: (to: Symbol) ->
|
72
|
+
# @rbs return: wasmValue
|
73
|
+
def extend_u: (to: Symbol) -> wasmValue
|
72
74
|
|
73
75
|
# @rbs to: Symbol
|
74
|
-
# @rbs return:
|
75
|
-
def trunc_s: (to: Symbol) ->
|
76
|
+
# @rbs return: wasmValue
|
77
|
+
def trunc_s: (to: Symbol) -> wasmValue
|
76
78
|
|
77
79
|
# @rbs to: Symbol
|
78
|
-
# @rbs return:
|
79
|
-
def trunc_u: (to: Symbol) ->
|
80
|
+
# @rbs return: wasmValue
|
81
|
+
def trunc_u: (to: Symbol) -> wasmValue
|
80
82
|
|
81
83
|
# @rbs to: Symbol
|
82
|
-
# @rbs return:
|
83
|
-
def convert_s: (to: Symbol) ->
|
84
|
+
# @rbs return: wasmValue
|
85
|
+
def convert_s: (to: Symbol) -> wasmValue
|
84
86
|
|
85
87
|
# @rbs to: Symbol
|
86
|
-
# @rbs return:
|
87
|
-
def convert_u: (to: Symbol) ->
|
88
|
+
# @rbs return: wasmValue
|
89
|
+
def convert_u: (to: Symbol) -> wasmValue
|
88
90
|
|
89
91
|
# @rbs to: Symbol
|
90
|
-
# @rbs return:
|
91
|
-
def demote: (to: Symbol) ->
|
92
|
+
# @rbs return: wasmValue
|
93
|
+
def demote: (to: Symbol) -> wasmValue
|
92
94
|
|
93
95
|
# @rbs to: Symbol
|
94
|
-
# @rbs return:
|
95
|
-
def promote: (to: Symbol) ->
|
96
|
+
# @rbs return: wasmValue
|
97
|
+
def promote: (to: Symbol) -> wasmValue
|
96
98
|
|
97
99
|
# @rbs to: Symbol
|
98
|
-
# @rbs return:
|
99
|
-
def reinterpret: (to: Symbol) ->
|
100
|
+
# @rbs return: wasmValue
|
101
|
+
def reinterpret: (to: Symbol) -> wasmValue
|
100
102
|
|
101
103
|
# I32#inspect shows signed value for convinience
|
102
104
|
def inspect: () -> untyped
|
@@ -127,44 +129,44 @@ module Wardite
|
|
127
129
|
def packed: (?size: Integer | nil) -> String
|
128
130
|
|
129
131
|
# @rbs to: Symbol
|
130
|
-
# @rbs return:
|
131
|
-
def wrap: (to: Symbol) ->
|
132
|
+
# @rbs return: wasmValue
|
133
|
+
def wrap: (to: Symbol) -> wasmValue
|
132
134
|
|
133
135
|
# @rbs to: Symbol
|
134
|
-
# @rbs return:
|
135
|
-
def extend_s: (to: Symbol) ->
|
136
|
+
# @rbs return: wasmValue
|
137
|
+
def extend_s: (to: Symbol) -> wasmValue
|
136
138
|
|
137
139
|
# @rbs to: Symbol
|
138
|
-
# @rbs return:
|
139
|
-
def extend_u: (to: Symbol) ->
|
140
|
+
# @rbs return: wasmValue
|
141
|
+
def extend_u: (to: Symbol) -> wasmValue
|
140
142
|
|
141
143
|
# @rbs to: Symbol
|
142
|
-
# @rbs return:
|
143
|
-
def trunc_s: (to: Symbol) ->
|
144
|
+
# @rbs return: wasmValue
|
145
|
+
def trunc_s: (to: Symbol) -> wasmValue
|
144
146
|
|
145
147
|
# @rbs to: Symbol
|
146
|
-
# @rbs return:
|
147
|
-
def trunc_u: (to: Symbol) ->
|
148
|
+
# @rbs return: wasmValue
|
149
|
+
def trunc_u: (to: Symbol) -> wasmValue
|
148
150
|
|
149
151
|
# @rbs to: Symbol
|
150
|
-
# @rbs return:
|
151
|
-
def convert_s: (to: Symbol) ->
|
152
|
+
# @rbs return: wasmValue
|
153
|
+
def convert_s: (to: Symbol) -> wasmValue
|
152
154
|
|
153
155
|
# @rbs to: Symbol
|
154
|
-
# @rbs return:
|
155
|
-
def convert_u: (to: Symbol) ->
|
156
|
+
# @rbs return: wasmValue
|
157
|
+
def convert_u: (to: Symbol) -> wasmValue
|
156
158
|
|
157
159
|
# @rbs to: Symbol
|
158
|
-
# @rbs return:
|
159
|
-
def demote: (to: Symbol) ->
|
160
|
+
# @rbs return: wasmValue
|
161
|
+
def demote: (to: Symbol) -> wasmValue
|
160
162
|
|
161
163
|
# @rbs to: Symbol
|
162
|
-
# @rbs return:
|
163
|
-
def promote: (to: Symbol) ->
|
164
|
+
# @rbs return: wasmValue
|
165
|
+
def promote: (to: Symbol) -> wasmValue
|
164
166
|
|
165
167
|
# @rbs to: Symbol
|
166
|
-
# @rbs return:
|
167
|
-
def reinterpret: (to: Symbol) ->
|
168
|
+
# @rbs return: wasmValue
|
169
|
+
def reinterpret: (to: Symbol) -> wasmValue
|
168
170
|
|
169
171
|
# I64#inspect shows signed value
|
170
172
|
def inspect: () -> untyped
|
@@ -190,47 +192,47 @@ module Wardite
|
|
190
192
|
def packed: (?size: Integer | nil) -> String
|
191
193
|
|
192
194
|
# @rbs to: Symbol
|
193
|
-
# @rbs return:
|
194
|
-
def wrap: (to: Symbol) ->
|
195
|
+
# @rbs return: wasmValue
|
196
|
+
def wrap: (to: Symbol) -> wasmValue
|
195
197
|
|
196
198
|
# @rbs to: Symbol
|
197
|
-
# @rbs return:
|
198
|
-
def extend_s: (to: Symbol) ->
|
199
|
+
# @rbs return: wasmValue
|
200
|
+
def extend_s: (to: Symbol) -> wasmValue
|
199
201
|
|
200
202
|
# @rbs to: Symbol
|
201
|
-
# @rbs return:
|
202
|
-
def extend_u: (to: Symbol) ->
|
203
|
+
# @rbs return: wasmValue
|
204
|
+
def extend_u: (to: Symbol) -> wasmValue
|
203
205
|
|
204
206
|
# @todo need more testcase...
|
205
207
|
# @see https://webassembly.github.io/spec/core/exec/numerics.html#xref-exec-numerics-op-trunc-s-mathrm-trunc-mathsf-s-m-n-z
|
206
208
|
# @rbs to: Symbol
|
207
|
-
# @rbs return:
|
208
|
-
def trunc_s: (to: Symbol) ->
|
209
|
+
# @rbs return: wasmValue
|
210
|
+
def trunc_s: (to: Symbol) -> wasmValue
|
209
211
|
|
210
212
|
# @see https://webassembly.github.io/spec/core/exec/numerics.html#xref-exec-numerics-op-trunc-u-mathrm-trunc-mathsf-u-m-n-z
|
211
213
|
# @rbs to: Symbol
|
212
|
-
# @rbs return:
|
213
|
-
def trunc_u: (to: Symbol) ->
|
214
|
+
# @rbs return: wasmValue
|
215
|
+
def trunc_u: (to: Symbol) -> wasmValue
|
214
216
|
|
215
217
|
# @rbs to: Symbol
|
216
|
-
# @rbs return:
|
217
|
-
def convert_s: (to: Symbol) ->
|
218
|
+
# @rbs return: wasmValue
|
219
|
+
def convert_s: (to: Symbol) -> wasmValue
|
218
220
|
|
219
221
|
# @rbs to: Symbol
|
220
|
-
# @rbs return:
|
221
|
-
def convert_u: (to: Symbol) ->
|
222
|
+
# @rbs return: wasmValue
|
223
|
+
def convert_u: (to: Symbol) -> wasmValue
|
222
224
|
|
223
225
|
# @rbs to: Symbol
|
224
|
-
# @rbs return:
|
225
|
-
def demote: (to: Symbol) ->
|
226
|
+
# @rbs return: wasmValue
|
227
|
+
def demote: (to: Symbol) -> wasmValue
|
226
228
|
|
227
229
|
# @rbs to: Symbol
|
228
|
-
# @rbs return:
|
229
|
-
def promote: (to: Symbol) ->
|
230
|
+
# @rbs return: wasmValue
|
231
|
+
def promote: (to: Symbol) -> wasmValue
|
230
232
|
|
231
233
|
# @rbs to: Symbol
|
232
|
-
# @rbs return:
|
233
|
-
def reinterpret: (to: Symbol) ->
|
234
|
+
# @rbs return: wasmValue
|
235
|
+
def reinterpret: (to: Symbol) -> wasmValue
|
234
236
|
|
235
237
|
def inspect: () -> untyped
|
236
238
|
end
|
@@ -255,47 +257,47 @@ module Wardite
|
|
255
257
|
def packed: (?size: Integer | nil) -> String
|
256
258
|
|
257
259
|
# @rbs to: Symbol
|
258
|
-
# @rbs return:
|
259
|
-
def wrap: (to: Symbol) ->
|
260
|
+
# @rbs return: wasmValue
|
261
|
+
def wrap: (to: Symbol) -> wasmValue
|
260
262
|
|
261
263
|
# @rbs to: Symbol
|
262
|
-
# @rbs return:
|
263
|
-
def extend_s: (to: Symbol) ->
|
264
|
+
# @rbs return: wasmValue
|
265
|
+
def extend_s: (to: Symbol) -> wasmValue
|
264
266
|
|
265
267
|
# @rbs to: Symbol
|
266
|
-
# @rbs return:
|
267
|
-
def extend_u: (to: Symbol) ->
|
268
|
+
# @rbs return: wasmValue
|
269
|
+
def extend_u: (to: Symbol) -> wasmValue
|
268
270
|
|
269
271
|
# @see the same as F32
|
270
272
|
# @rbs to: Symbol
|
271
|
-
# @rbs return:
|
272
|
-
def trunc_s: (to: Symbol) ->
|
273
|
+
# @rbs return: wasmValue
|
274
|
+
def trunc_s: (to: Symbol) -> wasmValue
|
273
275
|
|
274
276
|
# @see the same as F32
|
275
277
|
# @rbs to: Symbol
|
276
|
-
# @rbs return:
|
277
|
-
def trunc_u: (to: Symbol) ->
|
278
|
+
# @rbs return: wasmValue
|
279
|
+
def trunc_u: (to: Symbol) -> wasmValue
|
278
280
|
|
279
281
|
# @rbs to: Symbol
|
280
|
-
# @rbs return:
|
281
|
-
def convert_s: (to: Symbol) ->
|
282
|
+
# @rbs return: wasmValue
|
283
|
+
def convert_s: (to: Symbol) -> wasmValue
|
282
284
|
|
283
285
|
# @rbs to: Symbol
|
284
|
-
# @rbs return:
|
285
|
-
def convert_u: (to: Symbol) ->
|
286
|
+
# @rbs return: wasmValue
|
287
|
+
def convert_u: (to: Symbol) -> wasmValue
|
286
288
|
|
287
289
|
# @todo no loss of digits...
|
288
290
|
# @rbs to: Symbol
|
289
|
-
# @rbs return:
|
290
|
-
def demote: (to: Symbol) ->
|
291
|
+
# @rbs return: wasmValue
|
292
|
+
def demote: (to: Symbol) -> wasmValue
|
291
293
|
|
292
294
|
# @rbs to: Symbol
|
293
|
-
# @rbs return:
|
294
|
-
def promote: (to: Symbol) ->
|
295
|
+
# @rbs return: wasmValue
|
296
|
+
def promote: (to: Symbol) -> wasmValue
|
295
297
|
|
296
298
|
# @rbs to: Symbol
|
297
|
-
# @rbs return:
|
298
|
-
def reinterpret: (to: Symbol) ->
|
299
|
+
# @rbs return: wasmValue
|
300
|
+
def reinterpret: (to: Symbol) -> wasmValue
|
299
301
|
|
300
302
|
def inspect: () -> untyped
|
301
303
|
end
|
@@ -10,12 +10,12 @@ module Wardite
|
|
10
10
|
def initialize: () -> untyped
|
11
11
|
|
12
12
|
# @rbs store: Store
|
13
|
-
# @rbs args: Array[
|
13
|
+
# @rbs args: Array[wasmValue]
|
14
14
|
# @rbs return: Object
|
15
|
-
def fd_write: (Store store, Array[
|
15
|
+
def fd_write: (Store store, Array[wasmValue] args) -> Object
|
16
16
|
|
17
|
-
# @rbs return: Hash[Symbol,
|
18
|
-
def to_module: () -> Hash[Symbol,
|
17
|
+
# @rbs return: Hash[Symbol, wasmCallable]
|
18
|
+
def to_module: () -> Hash[Symbol, wasmCallable]
|
19
19
|
|
20
20
|
private
|
21
21
|
|