Skip to content

Commit 1c84527

Browse files
committed
update deno
1 parent 32244a2 commit 1c84527

File tree

6 files changed

+273
-329
lines changed

6 files changed

+273
-329
lines changed

Cargo.lock

Lines changed: 34 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrations/deno/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Deno bindings for the Melody language compiler
77
## Usage
88

99
```ts
10-
import init, { compiler } from 'https://deno.land/x/melody/melody_wasm.js';
11-
12-
await init();
10+
import { compiler } from 'https://deno.land/x/melody/melody_wasm.js';
1311

1412
const source = `
1513
<start>;

integrations/deno/melody_wasm.d.ts

Lines changed: 46 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,51 @@
11
/* tslint:disable */
22
/* eslint-disable */
33
/**
4-
*
5-
*Compiles Melody source code to a regular expression
6-
*
7-
*# Errors
8-
*
9-
*Throws an error if a compilation error is encountered
10-
*
11-
*# Example
12-
*
13-
*```js
14-
*import init, { compiler } from "https://deno.land/x/melody/melody_wasm.js";
15-
*
16-
*await init();
17-
*
18-
*const source = `
19-
* <start>;
20-
*
21-
* option of "v";
22-
*
23-
* capture major {
24-
* some of <digit>;
25-
* }
26-
*
27-
* ".";
28-
*
29-
* capture minor {
30-
* some of <digit>;
31-
* }
32-
*
33-
* ".";
34-
*
35-
* capture patch {
36-
* some of <digit>;
37-
* }
38-
*
39-
* <end>;
40-
*`;
41-
*
42-
*try {
43-
* const output = compiler(source);
44-
* new RegExp(output).test("v1.1.1"); // true
45-
*} catch (error) {
46-
* // handle compilation error
47-
*}
48-
*```
49-
* @param {string} source
50-
* @returns {string}
51-
*/
4+
*
5+
*Compiles Melody source code to a regular expression
6+
*
7+
*# Errors
8+
*
9+
*Throws an error if a compilation error is encountered
10+
*
11+
*# Example
12+
*
13+
*```js
14+
*const source = `
15+
* <start>;
16+
*
17+
* option of "v";
18+
*
19+
* capture major {
20+
* some of <digit>;
21+
* }
22+
*
23+
* ".";
24+
*
25+
* capture minor {
26+
* some of <digit>;
27+
* }
28+
*
29+
* ".";
30+
*
31+
* capture patch {
32+
* some of <digit>;
33+
* }
34+
*
35+
* <end>;
36+
*`;
37+
*
38+
*try {
39+
* const output = compiler(source);
40+
* new RegExp(output).test("v1.1.1"); // true
41+
*} catch (error) {
42+
* // handle compilation error
43+
*}
44+
*```
45+
* @param {string} source
46+
* @returns {string}
47+
*/
5248
export function compiler(source: string): string;
53-
54-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
55-
56-
export interface InitOutput {
57-
readonly memory: WebAssembly.Memory;
58-
readonly compiler: (a: number, b: number, c: number) => void;
59-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
60-
readonly __wbindgen_malloc: (a: number) => number;
61-
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
62-
readonly __wbindgen_free: (a: number, b: number) => void;
63-
}
64-
6549
/**
66-
* Synchronously compiles the given `bytes` and instantiates the WebAssembly module.
67-
*
68-
* @param {BufferSource} bytes
69-
*
70-
* @returns {InitOutput}
71-
*/
72-
export function initSync(bytes: BufferSource): InitOutput;
73-
74-
/**
75-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
76-
* for everything else, calls `WebAssembly.instantiate` directly.
77-
*
78-
* @param {InitInput | Promise<InitInput>} module_or_path
79-
*
80-
* @returns {Promise<InitOutput>}
81-
*/
82-
export default function init(module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
50+
*/
51+
export function main(): void;

0 commit comments

Comments
 (0)