@altopelago/aeon-wasm 0.12.0 → 0.13.0
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/README.md +29 -2
- package/dist/index.d.ts +98 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/pkg/aeon_wasm.d.ts +12 -0
- package/pkg/aeon_wasm.js +118 -2
- package/pkg/aeon_wasm_bg.wasm +0 -0
- package/pkg/aeon_wasm_bg.wasm.d.ts +4 -0
- package/pkg/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,28 @@ const result = await processAeon('name:string = "AEON"\n', {
|
|
|
17
17
|
console.log(result.finalized.document);
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
The same runtime exposes bulk Rust/WASM operations for Telex without creating
|
|
21
|
+
an intermediate JavaScript event graph:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
canonicalizeTelex,
|
|
26
|
+
checkTelexCompleteness,
|
|
27
|
+
materializeTelex,
|
|
28
|
+
validateTelex,
|
|
29
|
+
} from '@altopelago/aeon-wasm';
|
|
30
|
+
|
|
31
|
+
const validation = await validateTelex(telex);
|
|
32
|
+
const canonical = await canonicalizeTelex(telex);
|
|
33
|
+
const completeness = await checkTelexCompleteness(telex);
|
|
34
|
+
const materialized = await materializeTelex(telex);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
These operations accept the Telex resource limits as camel-case options. They
|
|
38
|
+
perform parsing and validation internally and return only the result needed by
|
|
39
|
+
the caller across the JavaScript/WASM boundary. `materializeTelex` consumes the
|
|
40
|
+
flat AES records directly; it does not reconstruct an AEON parser AST.
|
|
41
|
+
|
|
20
42
|
`processAeon` returns the normalized engine contract used by browser parity
|
|
21
43
|
tools:
|
|
22
44
|
|
|
@@ -45,5 +67,10 @@ Build the Rust WASM artifact:
|
|
|
45
67
|
pnpm --filter @altopelago/aeon-wasm build:wasm
|
|
46
68
|
```
|
|
47
69
|
|
|
48
|
-
`build:wasm` requires `wasm-pack` and reads the Rust crate from
|
|
49
|
-
`implementations/rust/crates/aeon-wasm`.
|
|
70
|
+
`build:wasm` requires exactly `wasm-pack 0.14.0` and reads the Rust crate from
|
|
71
|
+
`implementations/rust/crates/aeon-wasm`. The Rust compiler is pinned separately
|
|
72
|
+
by `implementations/rust/rust-toolchain.toml`. After generation, the build
|
|
73
|
+
script synchronizes `pkg/package.json` to the TypeScript wrapper version; the
|
|
74
|
+
wrapper and Rust crate can therefore remain separate release units. A Rust
|
|
75
|
+
toolchain or generator-version change is a reviewed build-input change and must
|
|
76
|
+
regenerate the committed `pkg/` artifacts.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,101 @@
|
|
|
1
1
|
export interface ProcessOptions {
|
|
2
2
|
validationMode?: 'strict' | 'custom' | 'loose' | 'none';
|
|
3
|
+
maxClarifierValues?: number;
|
|
4
|
+
/** @deprecated Use maxClarifierValues. */
|
|
3
5
|
maxSeparatorDepth?: number;
|
|
4
6
|
maxAttributeDepth?: number;
|
|
5
7
|
maxGenericDepth?: number;
|
|
8
|
+
maxGenericArguments?: number;
|
|
9
|
+
maxDatatypeComponents?: number;
|
|
6
10
|
materializationMode?: 'all' | 'projected';
|
|
7
11
|
finalizeScope?: 'payload' | 'header' | 'full';
|
|
8
12
|
includePaths?: string[];
|
|
9
13
|
}
|
|
14
|
+
export interface TelexOptions {
|
|
15
|
+
/** Trusted AEON-encoded common limits document; WASM performs no host file I/O. */
|
|
16
|
+
limitsSource?: string;
|
|
17
|
+
registeredFields?: string[];
|
|
18
|
+
maxInputBytes?: number;
|
|
19
|
+
maxLineBytes?: number;
|
|
20
|
+
maxFieldsPerEvent?: number;
|
|
21
|
+
maxEvents?: number;
|
|
22
|
+
maxDecodedPayloadBytes?: number;
|
|
23
|
+
maxPathDepth?: number;
|
|
24
|
+
maxPathCharacters?: number;
|
|
25
|
+
maxAttributeDepth?: number;
|
|
26
|
+
maxValueNestingDepth?: number;
|
|
27
|
+
maxStringCodepoints?: number;
|
|
28
|
+
maxKeySegmentCodepoints?: number;
|
|
29
|
+
maxListItems?: number;
|
|
30
|
+
maxTupleItems?: number;
|
|
31
|
+
maxGenericDepth?: number;
|
|
32
|
+
maxGenericArguments?: number;
|
|
33
|
+
maxClarifierValues?: number;
|
|
34
|
+
maxDatatypeComponents?: number;
|
|
35
|
+
finalizeMode?: 'strict' | 'loose';
|
|
36
|
+
finalizeScope?: 'payload' | 'header' | 'full';
|
|
37
|
+
maxMaterializedWeight?: number;
|
|
38
|
+
maxReferenceDepth?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface EffectiveTelexConfiguration {
|
|
41
|
+
limitsId: string;
|
|
42
|
+
limitsVersion: string;
|
|
43
|
+
profileClaims: string[];
|
|
44
|
+
telex: Required<Omit<TelexOptions, 'limitsSource' | 'registeredFields' | 'finalizeMode' | 'finalizeScope' | 'maxMaterializedWeight' | 'maxReferenceDepth'>>;
|
|
45
|
+
finalization: {
|
|
46
|
+
maxMaterializedWeight: number | null;
|
|
47
|
+
maxReferenceDepth: number | null;
|
|
48
|
+
};
|
|
49
|
+
overridesApplied: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface TelexDiagnostic {
|
|
52
|
+
code: string;
|
|
53
|
+
message: string;
|
|
54
|
+
record: number | null;
|
|
55
|
+
path: string | null;
|
|
56
|
+
field: string | null;
|
|
57
|
+
firstRecord: number | null;
|
|
58
|
+
requiredPath: string | null;
|
|
59
|
+
counter: string | null;
|
|
60
|
+
observed: number | null;
|
|
61
|
+
limit: number | null;
|
|
62
|
+
}
|
|
63
|
+
export interface TelexValidationResult {
|
|
64
|
+
valid: boolean;
|
|
65
|
+
profile: string;
|
|
66
|
+
diagnostics: TelexDiagnostic[];
|
|
67
|
+
effectiveLimits?: EffectiveTelexConfiguration;
|
|
68
|
+
}
|
|
69
|
+
export interface MissingTelexPath {
|
|
70
|
+
field?: 'header';
|
|
71
|
+
path: string;
|
|
72
|
+
requiredBy: string;
|
|
73
|
+
}
|
|
74
|
+
export interface TelexCompletenessResult {
|
|
75
|
+
complete: boolean;
|
|
76
|
+
missing: MissingTelexPath[];
|
|
77
|
+
effectiveLimits?: EffectiveTelexConfiguration;
|
|
78
|
+
}
|
|
79
|
+
export interface TelexMaterializationResult {
|
|
80
|
+
document: unknown;
|
|
81
|
+
meta: NormalizedDiagnostics;
|
|
82
|
+
effectiveLimits?: EffectiveTelexConfiguration;
|
|
83
|
+
}
|
|
84
|
+
export declare class TelexWasmError extends Error {
|
|
85
|
+
readonly code: string;
|
|
86
|
+
readonly line: number | null;
|
|
87
|
+
readonly counter: string | null;
|
|
88
|
+
readonly observed: number | null;
|
|
89
|
+
readonly limit: number | null;
|
|
90
|
+
constructor(details: {
|
|
91
|
+
code?: string;
|
|
92
|
+
line?: number | null;
|
|
93
|
+
message?: string;
|
|
94
|
+
counter?: string | null;
|
|
95
|
+
observed?: number | null;
|
|
96
|
+
limit?: number | null;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
10
99
|
export interface Position {
|
|
11
100
|
line: number;
|
|
12
101
|
column: number;
|
|
@@ -30,8 +119,8 @@ export interface AnnotationTarget {
|
|
|
30
119
|
}
|
|
31
120
|
export interface AnnotationRecord {
|
|
32
121
|
kind: string;
|
|
33
|
-
form: string;
|
|
34
122
|
subtype: string | null;
|
|
123
|
+
form: string;
|
|
35
124
|
raw: string;
|
|
36
125
|
span: Span;
|
|
37
126
|
target: AnnotationTarget;
|
|
@@ -71,7 +160,15 @@ export interface ProcessResult {
|
|
|
71
160
|
}
|
|
72
161
|
export interface AeonWasmRuntime {
|
|
73
162
|
processAeon(source: string, options?: ProcessOptions): ProcessResult;
|
|
163
|
+
validateTelex(source: string, options?: TelexOptions): TelexValidationResult;
|
|
164
|
+
canonicalizeTelex(source: string, options?: TelexOptions): string;
|
|
165
|
+
checkTelexCompleteness(source: string, options?: TelexOptions): TelexCompletenessResult;
|
|
166
|
+
materializeTelex(source: string, options?: TelexOptions): TelexMaterializationResult;
|
|
74
167
|
}
|
|
75
168
|
export declare function loadAeonWasm(initInput?: unknown): Promise<AeonWasmRuntime>;
|
|
76
169
|
export declare function processAeon(source: string, options?: ProcessOptions): Promise<ProcessResult>;
|
|
170
|
+
export declare function validateTelex(source: string, options?: TelexOptions): Promise<TelexValidationResult>;
|
|
171
|
+
export declare function canonicalizeTelex(source: string, options?: TelexOptions): Promise<string>;
|
|
172
|
+
export declare function checkTelexCompleteness(source: string, options?: TelexOptions): Promise<TelexCompletenessResult>;
|
|
173
|
+
export declare function materializeTelex(source: string, options?: TelexOptions): Promise<TelexMaterializationResult>;
|
|
77
174
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;IAC1C,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,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AAW,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAGhC;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,0BAA0B,CAAC,CAGrC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
export class TelexWasmError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
line;
|
|
4
|
+
counter;
|
|
5
|
+
observed;
|
|
6
|
+
limit;
|
|
7
|
+
constructor(details) {
|
|
8
|
+
super(details.message ?? 'Telex WASM operation failed');
|
|
9
|
+
this.name = 'TelexWasmError';
|
|
10
|
+
this.code = details.code ?? 'TELEX_WASM_ERROR';
|
|
11
|
+
this.line = details.line ?? null;
|
|
12
|
+
this.counter = details.counter ?? null;
|
|
13
|
+
this.observed = details.observed ?? null;
|
|
14
|
+
this.limit = details.limit ?? null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
1
17
|
let runtimePromise;
|
|
2
18
|
export async function loadAeonWasm(initInput) {
|
|
3
19
|
runtimePromise ??= loadGeneratedModule(initInput);
|
|
@@ -7,6 +23,22 @@ export async function processAeon(source, options = {}) {
|
|
|
7
23
|
const runtime = await loadAeonWasm();
|
|
8
24
|
return runtime.processAeon(source, options);
|
|
9
25
|
}
|
|
26
|
+
export async function validateTelex(source, options = {}) {
|
|
27
|
+
const runtime = await loadAeonWasm();
|
|
28
|
+
return runtime.validateTelex(source, options);
|
|
29
|
+
}
|
|
30
|
+
export async function canonicalizeTelex(source, options = {}) {
|
|
31
|
+
const runtime = await loadAeonWasm();
|
|
32
|
+
return runtime.canonicalizeTelex(source, options);
|
|
33
|
+
}
|
|
34
|
+
export async function checkTelexCompleteness(source, options = {}) {
|
|
35
|
+
const runtime = await loadAeonWasm();
|
|
36
|
+
return runtime.checkTelexCompleteness(source, options);
|
|
37
|
+
}
|
|
38
|
+
export async function materializeTelex(source, options = {}) {
|
|
39
|
+
const runtime = await loadAeonWasm();
|
|
40
|
+
return runtime.materializeTelex(source, options);
|
|
41
|
+
}
|
|
10
42
|
async function loadGeneratedModule(initInput) {
|
|
11
43
|
let module;
|
|
12
44
|
try {
|
|
@@ -22,8 +54,43 @@ async function loadGeneratedModule(initInput) {
|
|
|
22
54
|
processAeon(source, options = {}) {
|
|
23
55
|
return parseProcessResult(module.process_aeon(source, JSON.stringify(options)));
|
|
24
56
|
},
|
|
57
|
+
validateTelex(source, options = {}) {
|
|
58
|
+
return parseTelexResult(invokeTelex(() => module.validate_telex(source, JSON.stringify(options))));
|
|
59
|
+
},
|
|
60
|
+
canonicalizeTelex(source, options = {}) {
|
|
61
|
+
return invokeTelex(() => module.canonicalize_telex(source, JSON.stringify(options)));
|
|
62
|
+
},
|
|
63
|
+
checkTelexCompleteness(source, options = {}) {
|
|
64
|
+
return parseTelexResult(invokeTelex(() => module.check_telex_completeness(source, JSON.stringify(options))));
|
|
65
|
+
},
|
|
66
|
+
materializeTelex(source, options = {}) {
|
|
67
|
+
return parseTelexResult(invokeTelex(() => module.materialize_telex(source, JSON.stringify(options))));
|
|
68
|
+
},
|
|
25
69
|
};
|
|
26
70
|
}
|
|
71
|
+
function invokeTelex(operation) {
|
|
72
|
+
try {
|
|
73
|
+
return operation();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const message = typeof error === 'string'
|
|
77
|
+
? error
|
|
78
|
+
: error instanceof Error
|
|
79
|
+
? error.message
|
|
80
|
+
: String(error);
|
|
81
|
+
try {
|
|
82
|
+
throw new TelexWasmError(JSON.parse(message));
|
|
83
|
+
}
|
|
84
|
+
catch (parseError) {
|
|
85
|
+
if (parseError instanceof TelexWasmError)
|
|
86
|
+
throw parseError;
|
|
87
|
+
throw new TelexWasmError({ message });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function parseTelexResult(json) {
|
|
92
|
+
return JSON.parse(json);
|
|
93
|
+
}
|
|
27
94
|
function parseProcessResult(json) {
|
|
28
95
|
return normalizeProcessResult(JSON.parse(json));
|
|
29
96
|
}
|
|
@@ -54,8 +121,8 @@ function normalizeDiagnostic(diagnostic) {
|
|
|
54
121
|
function normalizeAnnotation(annotation) {
|
|
55
122
|
return {
|
|
56
123
|
kind: annotation.kind,
|
|
57
|
-
form: annotation.form,
|
|
58
124
|
subtype: annotation.subtype ?? null,
|
|
125
|
+
form: annotation.form,
|
|
59
126
|
raw: annotation.raw,
|
|
60
127
|
span: annotation.span,
|
|
61
128
|
target: annotation.target,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6FA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAS;IACb,IAAI,CAAgB;IACpB,OAAO,CAAgB;IACvB,QAAQ,CAAgB;IACxB,KAAK,CAAgB;IAE9B,YAAY,OAOX;QACC,KAAK,CAAC,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,IAAI,GAA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S,EAAE,UAAU,CAAC,SAAS,IAAI,IAAI;KACxC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAmB;IACzC,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI;QAChC,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/pkg/aeon_wasm.d.ts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
export function canonicalize_telex(source: string, options_json: string): string;
|
|
5
|
+
|
|
6
|
+
export function check_telex_completeness(source: string, options_json: string): string;
|
|
7
|
+
|
|
8
|
+
export function materialize_telex(source: string, options_json: string): string;
|
|
9
|
+
|
|
4
10
|
export function process_aeon(source: string, options_json: string): string;
|
|
5
11
|
|
|
12
|
+
export function validate_telex(source: string, options_json: string): string;
|
|
13
|
+
|
|
6
14
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
7
15
|
|
|
8
16
|
export interface InitOutput {
|
|
9
17
|
readonly memory: WebAssembly.Memory;
|
|
18
|
+
readonly canonicalize_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
19
|
+
readonly check_telex_completeness: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
20
|
+
readonly materialize_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
10
21
|
readonly process_aeon: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
22
|
+
readonly validate_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
11
23
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
12
24
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
13
25
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
package/pkg/aeon_wasm.js
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
/* @ts-self-types="./aeon_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} source
|
|
5
|
+
* @param {string} options_json
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
export function canonicalize_telex(source, options_json) {
|
|
9
|
+
let deferred4_0;
|
|
10
|
+
let deferred4_1;
|
|
11
|
+
try {
|
|
12
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
13
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
15
|
+
const len1 = WASM_VECTOR_LEN;
|
|
16
|
+
const ret = wasm.canonicalize_telex(ptr0, len0, ptr1, len1);
|
|
17
|
+
var ptr3 = ret[0];
|
|
18
|
+
var len3 = ret[1];
|
|
19
|
+
if (ret[3]) {
|
|
20
|
+
ptr3 = 0; len3 = 0;
|
|
21
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
22
|
+
}
|
|
23
|
+
deferred4_0 = ptr3;
|
|
24
|
+
deferred4_1 = len3;
|
|
25
|
+
return getStringFromWasm0(ptr3, len3);
|
|
26
|
+
} finally {
|
|
27
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} source
|
|
33
|
+
* @param {string} options_json
|
|
34
|
+
* @returns {string}
|
|
35
|
+
*/
|
|
36
|
+
export function check_telex_completeness(source, options_json) {
|
|
37
|
+
let deferred4_0;
|
|
38
|
+
let deferred4_1;
|
|
39
|
+
try {
|
|
40
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
41
|
+
const len0 = WASM_VECTOR_LEN;
|
|
42
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
43
|
+
const len1 = WASM_VECTOR_LEN;
|
|
44
|
+
const ret = wasm.check_telex_completeness(ptr0, len0, ptr1, len1);
|
|
45
|
+
var ptr3 = ret[0];
|
|
46
|
+
var len3 = ret[1];
|
|
47
|
+
if (ret[3]) {
|
|
48
|
+
ptr3 = 0; len3 = 0;
|
|
49
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
50
|
+
}
|
|
51
|
+
deferred4_0 = ptr3;
|
|
52
|
+
deferred4_1 = len3;
|
|
53
|
+
return getStringFromWasm0(ptr3, len3);
|
|
54
|
+
} finally {
|
|
55
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} source
|
|
61
|
+
* @param {string} options_json
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
export function materialize_telex(source, options_json) {
|
|
65
|
+
let deferred4_0;
|
|
66
|
+
let deferred4_1;
|
|
67
|
+
try {
|
|
68
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
69
|
+
const len0 = WASM_VECTOR_LEN;
|
|
70
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
71
|
+
const len1 = WASM_VECTOR_LEN;
|
|
72
|
+
const ret = wasm.materialize_telex(ptr0, len0, ptr1, len1);
|
|
73
|
+
var ptr3 = ret[0];
|
|
74
|
+
var len3 = ret[1];
|
|
75
|
+
if (ret[3]) {
|
|
76
|
+
ptr3 = 0; len3 = 0;
|
|
77
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
78
|
+
}
|
|
79
|
+
deferred4_0 = ptr3;
|
|
80
|
+
deferred4_1 = len3;
|
|
81
|
+
return getStringFromWasm0(ptr3, len3);
|
|
82
|
+
} finally {
|
|
83
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
3
87
|
/**
|
|
4
88
|
* @param {string} source
|
|
5
89
|
* @param {string} options_json
|
|
@@ -27,10 +111,38 @@ export function process_aeon(source, options_json) {
|
|
|
27
111
|
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
28
112
|
}
|
|
29
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param {string} source
|
|
117
|
+
* @param {string} options_json
|
|
118
|
+
* @returns {string}
|
|
119
|
+
*/
|
|
120
|
+
export function validate_telex(source, options_json) {
|
|
121
|
+
let deferred4_0;
|
|
122
|
+
let deferred4_1;
|
|
123
|
+
try {
|
|
124
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
127
|
+
const len1 = WASM_VECTOR_LEN;
|
|
128
|
+
const ret = wasm.validate_telex(ptr0, len0, ptr1, len1);
|
|
129
|
+
var ptr3 = ret[0];
|
|
130
|
+
var len3 = ret[1];
|
|
131
|
+
if (ret[3]) {
|
|
132
|
+
ptr3 = 0; len3 = 0;
|
|
133
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
134
|
+
}
|
|
135
|
+
deferred4_0 = ptr3;
|
|
136
|
+
deferred4_1 = len3;
|
|
137
|
+
return getStringFromWasm0(ptr3, len3);
|
|
138
|
+
} finally {
|
|
139
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
30
142
|
function __wbg_get_imports() {
|
|
31
143
|
const import0 = {
|
|
32
144
|
__proto__: null,
|
|
33
|
-
|
|
145
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
34
146
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
35
147
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
36
148
|
return ret;
|
|
@@ -147,11 +259,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
147
259
|
|
|
148
260
|
async function __wbg_load(module, imports) {
|
|
149
261
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
262
|
+
if (!module.ok) {
|
|
263
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
264
|
+
}
|
|
265
|
+
|
|
150
266
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
151
267
|
try {
|
|
152
268
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
153
269
|
} catch (e) {
|
|
154
|
-
const validResponse =
|
|
270
|
+
const validResponse = expectedResponseType(module.type);
|
|
155
271
|
|
|
156
272
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
157
273
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
package/pkg/aeon_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const canonicalize_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
5
|
+
export const check_telex_completeness: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
6
|
+
export const materialize_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
4
7
|
export const process_aeon: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
8
|
+
export const validate_telex: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
5
9
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
6
10
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
7
11
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|