ros-madair 0.1.0-alpha.21 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ros_madair_wasm.d.ts +7 -9
- package/ros_madair_wasm.js +79 -38
- package/ros_madair_wasm_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Phil Weir <phil.weir@flaxandteal.co.uk>"
|
|
6
6
|
],
|
|
7
7
|
"description": "wasm-bindgen surface over ros-madair-compile: lower a Query IR (JSON) + models (JSON) to DuckDB SQL in the browser, for duckdb-wasm to execute. The browser's half of 'one compiler, two consumers'.",
|
|
8
|
-
"version": "0.1.0-alpha.
|
|
8
|
+
"version": "0.1.0-alpha.23",
|
|
9
9
|
"license": "AGPL-3.0-or-later",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
package/ros_madair_wasm.d.ts
CHANGED
|
@@ -42,20 +42,18 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
42
42
|
export interface InitOutput {
|
|
43
43
|
readonly memory: WebAssembly.Memory;
|
|
44
44
|
readonly __wbg_compiler_free: (a: number, b: number) => void;
|
|
45
|
-
readonly compile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number
|
|
46
|
-
readonly compiler_compile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
47
|
-
readonly compiler_new: (a: number, b: number
|
|
45
|
+
readonly compile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
46
|
+
readonly compiler_compile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
47
|
+
readonly compiler_new: (a: number, b: number, c: number) => void;
|
|
48
48
|
readonly alizarin_free_resolve_markers_result: (a: number) => void;
|
|
49
49
|
readonly alizarin_free_render_display_result: (a: number) => void;
|
|
50
50
|
readonly alizarin_free_coerce_result: (a: number) => void;
|
|
51
51
|
readonly alizarin_free_mutation_output: (a: number, b: number) => void;
|
|
52
52
|
readonly alizarin_free_mutation_result: (a: number) => void;
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
58
|
-
readonly __wbindgen_start: () => void;
|
|
53
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
54
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
55
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
56
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/ros_madair_wasm.js
CHANGED
|
@@ -39,20 +39,26 @@ export class Compiler {
|
|
|
39
39
|
let deferred3_0;
|
|
40
40
|
let deferred3_1;
|
|
41
41
|
try {
|
|
42
|
-
const
|
|
42
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
43
|
+
const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
43
44
|
const len0 = WASM_VECTOR_LEN;
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
|
|
45
|
+
wasm.compiler_compile(retptr, this.__wbg_ptr, ptr0, len0, has_catalog, has_edges, has_concept_index, has_ordered, spatial);
|
|
46
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
47
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
48
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
49
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
50
|
+
var ptr2 = r0;
|
|
51
|
+
var len2 = r1;
|
|
52
|
+
if (r3) {
|
|
48
53
|
ptr2 = 0; len2 = 0;
|
|
49
|
-
throw
|
|
54
|
+
throw takeObject(r2);
|
|
50
55
|
}
|
|
51
56
|
deferred3_0 = ptr2;
|
|
52
57
|
deferred3_1 = len2;
|
|
53
58
|
return getStringFromWasm0(ptr2, len2);
|
|
54
59
|
} finally {
|
|
55
|
-
wasm.
|
|
60
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
61
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
@@ -62,15 +68,23 @@ export class Compiler {
|
|
|
62
68
|
* @param {string} graphs_json
|
|
63
69
|
*/
|
|
64
70
|
constructor(graphs_json) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
try {
|
|
72
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
73
|
+
const ptr0 = passStringToWasm0(graphs_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
74
|
+
const len0 = WASM_VECTOR_LEN;
|
|
75
|
+
wasm.compiler_new(retptr, ptr0, len0);
|
|
76
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
77
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
78
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
79
|
+
if (r2) {
|
|
80
|
+
throw takeObject(r1);
|
|
81
|
+
}
|
|
82
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
83
|
+
CompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
84
|
+
return this;
|
|
85
|
+
} finally {
|
|
86
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
70
87
|
}
|
|
71
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
72
|
-
CompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
73
|
-
return this;
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
90
|
if (Symbol.dispose) Compiler.prototype[Symbol.dispose] = Compiler.prototype.free;
|
|
@@ -92,22 +106,28 @@ export function compile(graphs_json, query_json, has_catalog, has_edges, has_con
|
|
|
92
106
|
let deferred4_0;
|
|
93
107
|
let deferred4_1;
|
|
94
108
|
try {
|
|
95
|
-
const
|
|
109
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
110
|
+
const ptr0 = passStringToWasm0(graphs_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
96
111
|
const len0 = WASM_VECTOR_LEN;
|
|
97
|
-
const ptr1 = passStringToWasm0(query_json, wasm.
|
|
112
|
+
const ptr1 = passStringToWasm0(query_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
98
113
|
const len1 = WASM_VECTOR_LEN;
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
|
|
114
|
+
wasm.compile(retptr, ptr0, len0, ptr1, len1, has_catalog, has_edges, has_concept_index, has_ordered, spatial);
|
|
115
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
116
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
117
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
118
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
119
|
+
var ptr3 = r0;
|
|
120
|
+
var len3 = r1;
|
|
121
|
+
if (r3) {
|
|
103
122
|
ptr3 = 0; len3 = 0;
|
|
104
|
-
throw
|
|
123
|
+
throw takeObject(r2);
|
|
105
124
|
}
|
|
106
125
|
deferred4_0 = ptr3;
|
|
107
126
|
deferred4_1 = len3;
|
|
108
127
|
return getStringFromWasm0(ptr3, len3);
|
|
109
128
|
} finally {
|
|
110
|
-
wasm.
|
|
129
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
130
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
111
131
|
}
|
|
112
132
|
}
|
|
113
133
|
function __wbg_get_imports() {
|
|
@@ -115,20 +135,11 @@ function __wbg_get_imports() {
|
|
|
115
135
|
__proto__: null,
|
|
116
136
|
__wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
|
|
117
137
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
118
|
-
return ret;
|
|
138
|
+
return addHeapObject(ret);
|
|
119
139
|
},
|
|
120
140
|
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
121
141
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
122
142
|
},
|
|
123
|
-
__wbindgen_init_externref_table: function() {
|
|
124
|
-
const table = wasm.__wbindgen_externrefs;
|
|
125
|
-
const offset = table.grow(4);
|
|
126
|
-
table.set(0, undefined);
|
|
127
|
-
table.set(offset + 0, undefined);
|
|
128
|
-
table.set(offset + 1, null);
|
|
129
|
-
table.set(offset + 2, true);
|
|
130
|
-
table.set(offset + 3, false);
|
|
131
|
-
},
|
|
132
143
|
};
|
|
133
144
|
return {
|
|
134
145
|
__proto__: null,
|
|
@@ -140,6 +151,29 @@ const CompilerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
140
151
|
? { register: () => {}, unregister: () => {} }
|
|
141
152
|
: new FinalizationRegistry(ptr => wasm.__wbg_compiler_free(ptr >>> 0, 1));
|
|
142
153
|
|
|
154
|
+
function addHeapObject(obj) {
|
|
155
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
156
|
+
const idx = heap_next;
|
|
157
|
+
heap_next = heap[idx];
|
|
158
|
+
|
|
159
|
+
heap[idx] = obj;
|
|
160
|
+
return idx;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function dropObject(idx) {
|
|
164
|
+
if (idx < 1028) return;
|
|
165
|
+
heap[idx] = heap_next;
|
|
166
|
+
heap_next = idx;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
let cachedDataViewMemory0 = null;
|
|
170
|
+
function getDataViewMemory0() {
|
|
171
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
172
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
173
|
+
}
|
|
174
|
+
return cachedDataViewMemory0;
|
|
175
|
+
}
|
|
176
|
+
|
|
143
177
|
function getStringFromWasm0(ptr, len) {
|
|
144
178
|
ptr = ptr >>> 0;
|
|
145
179
|
return decodeText(ptr, len);
|
|
@@ -153,6 +187,13 @@ function getUint8ArrayMemory0() {
|
|
|
153
187
|
return cachedUint8ArrayMemory0;
|
|
154
188
|
}
|
|
155
189
|
|
|
190
|
+
function getObject(idx) { return heap[idx]; }
|
|
191
|
+
|
|
192
|
+
let heap = new Array(1024).fill(undefined);
|
|
193
|
+
heap.push(undefined, null, true, false);
|
|
194
|
+
|
|
195
|
+
let heap_next = heap.length;
|
|
196
|
+
|
|
156
197
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
157
198
|
if (realloc === undefined) {
|
|
158
199
|
const buf = cachedTextEncoder.encode(arg);
|
|
@@ -190,10 +231,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
190
231
|
return ptr;
|
|
191
232
|
}
|
|
192
233
|
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
return
|
|
234
|
+
function takeObject(idx) {
|
|
235
|
+
const ret = getObject(idx);
|
|
236
|
+
dropObject(idx);
|
|
237
|
+
return ret;
|
|
197
238
|
}
|
|
198
239
|
|
|
199
240
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -229,8 +270,8 @@ let wasmModule, wasm;
|
|
|
229
270
|
function __wbg_finalize_init(instance, module) {
|
|
230
271
|
wasm = instance.exports;
|
|
231
272
|
wasmModule = module;
|
|
273
|
+
cachedDataViewMemory0 = null;
|
|
232
274
|
cachedUint8ArrayMemory0 = null;
|
|
233
|
-
wasm.__wbindgen_start();
|
|
234
275
|
return wasm;
|
|
235
276
|
}
|
|
236
277
|
|
package/ros_madair_wasm_bg.wasm
CHANGED
|
Binary file
|