diff --git a/assets/wasm/r/r.d.ts b/assets/wasm/r/r.d.ts index 75ab9ea..58ee69a 100644 --- a/assets/wasm/r/r.d.ts +++ b/assets/wasm/r/r.d.ts @@ -29,6 +29,12 @@ export function wasm_parse_errors(args: any, input: string): (ParseError)[]; export function wasm_highlight(args: any, input: string): any[]; /** */ +export enum Experiment { + TailCalls = 0, + RestArgs = 1, +} +/** +*/ export enum Localization { En = 0, Es = 1, @@ -38,12 +44,6 @@ export enum Localization { Emoji = 5, } /** -*/ -export enum Experiment { - TailCalls = 0, - RestArgs = 1, -} -/** * Run the R REPL */ export class Cli { @@ -83,13 +83,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl export interface InitOutput { readonly memory: WebAssembly.Memory; - readonly __wbg_cli_free: (a: number) => void; - readonly __wbg_get_cli_locale: (a: number) => number; - readonly __wbg_set_cli_locale: (a: number, b: number) => void; - readonly __wbg_get_cli_warranty: (a: number) => number; - readonly __wbg_set_cli_warranty: (a: number, b: number) => void; - readonly __wbg_get_cli_experiments: (a: number, b: number) => void; - readonly __wbg_set_cli_experiments: (a: number, b: number, c: number) => void; readonly __wbg_parseerror_free: (a: number) => void; readonly parseerror_start: (a: number) => number; readonly parseerror_end: (a: number) => number; @@ -98,6 +91,13 @@ export interface InitOutput { readonly wasm_runtime: (a: number) => number; readonly wasm_parse_errors: (a: number, b: number, c: number, d: number) => void; readonly wasm_highlight: (a: number, b: number, c: number, d: number) => void; + readonly __wbg_cli_free: (a: number) => void; + readonly __wbg_get_cli_locale: (a: number) => number; + readonly __wbg_set_cli_locale: (a: number, b: number) => void; + readonly __wbg_get_cli_warranty: (a: number) => number; + readonly __wbg_set_cli_warranty: (a: number, b: number) => void; + readonly __wbg_get_cli_experiments: (a: number, b: number) => void; + readonly __wbg_set_cli_experiments: (a: number, b: number, c: number) => void; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; diff --git a/assets/wasm/r/r.js b/assets/wasm/r/r.js index 1fee358..7fc3d82 100644 --- a/assets/wasm/r/r.js +++ b/assets/wasm/r/r.js @@ -35,6 +35,18 @@ function addHeapObject(obj) { function getObject(idx) { return heap[idx]; } +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + function isLikeNone(x) { return x === undefined || x === null; } @@ -57,18 +69,6 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - let WASM_VECTOR_LEN = 0; const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); @@ -171,35 +171,6 @@ function __wbg_adapter_28(arg0, arg1, arg2, arg3) { } } -let cachedUint32Memory0 = null; - -function getUint32Memory0() { - if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) { - cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer); - } - return cachedUint32Memory0; -} - -function getArrayJsValueFromWasm0(ptr, len) { - ptr = ptr >>> 0; - const mem = getUint32Memory0(); - const slice = mem.subarray(ptr / 4, ptr / 4 + len); - const result = []; - for (let i = 0; i < slice.length; i++) { - result.push(takeObject(slice[i])); - } - return result; -} - -function passArrayJsValueToWasm0(array, malloc) { - const ptr = malloc(array.length * 4, 4) >>> 0; - const mem = getUint32Memory0(); - for (let i = 0; i < array.length; i++) { - mem[ptr / 4 + i] = addHeapObject(array[i]); - } - WASM_VECTOR_LEN = array.length; - return ptr; -} /** * @param {any} args * @returns {string} @@ -230,6 +201,25 @@ export function wasm_runtime(args) { return takeObject(ret); } +let cachedUint32Memory0 = null; + +function getUint32Memory0() { + if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) { + cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32Memory0; +} + +function getArrayJsValueFromWasm0(ptr, len) { + ptr = ptr >>> 0; + const mem = getUint32Memory0(); + const slice = mem.subarray(ptr / 4, ptr / 4 + len); + const result = []; + for (let i = 0; i < slice.length; i++) { + result.push(takeObject(slice[i])); + } + return result; +} /** * Check whether an input produces parse errors * @@ -277,6 +267,16 @@ export function wasm_highlight(args, input) { } } +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + const mem = getUint32Memory0(); + for (let i = 0; i < array.length; i++) { + mem[ptr / 4 + i] = addHeapObject(array[i]); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} + function handleError(f, args) { try { return f.apply(this, args); @@ -286,10 +286,10 @@ function handleError(f, args) { } /** */ -export const Localization = Object.freeze({ En:0,"0":"En",Es:1,"1":"Es",Zh:2,"2":"Zh",De:3,"3":"De",Pirate:4,"4":"Pirate",Emoji:5,"5":"Emoji", }); +export const Experiment = Object.freeze({ TailCalls:0,"0":"TailCalls",RestArgs:1,"1":"RestArgs", }); /** */ -export const Experiment = Object.freeze({ TailCalls:0,"0":"TailCalls",RestArgs:1,"1":"RestArgs", }); +export const Localization = Object.freeze({ En:0,"0":"En",Es:1,"1":"Es",Zh:2,"2":"Zh",De:3,"3":"De",Pirate:4,"4":"Pirate",Emoji:5,"5":"Emoji", }); const CliFinalization = (typeof FinalizationRegistry === 'undefined') ? { register: () => {}, unregister: () => {} } @@ -475,9 +475,15 @@ function __wbg_get_imports() { const ret = ParseError.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_undefined = function(arg0) { - const ret = getObject(arg0) === undefined; - return ret; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbg_log_622c0899e43adbe8 = function(arg0, arg1) { + console.log(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); }; imports.wbg.__wbindgen_try_into_number = function(arg0) { let result; @@ -491,15 +497,9 @@ imports.wbg.__wbindgen_number_get = function(arg0, arg1) { getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); }; -imports.wbg.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); -}; -imports.wbg.__wbg_log_622c0899e43adbe8 = function(arg0, arg1) { - console.log(getStringFromWasm0(arg0, arg1)); -}; -imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); +imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; }; imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) { const ret = getObject(arg0).crypto; @@ -614,8 +614,8 @@ imports.wbg.__wbindgen_memory = function() { const ret = wasm.memory; return addHeapObject(ret); }; -imports.wbg.__wbindgen_closure_wrapper2880 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 1029, __wbg_adapter_28); +imports.wbg.__wbindgen_closure_wrapper2326 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 580, __wbg_adapter_28); return addHeapObject(ret); }; diff --git a/assets/wasm/r/r_bg.wasm b/assets/wasm/r/r_bg.wasm index b7f5158..f65ad75 100644 Binary files a/assets/wasm/r/r_bg.wasm and b/assets/wasm/r/r_bg.wasm differ diff --git a/assets/wasm/r/r_bg.wasm.d.ts b/assets/wasm/r/r_bg.wasm.d.ts index 12c7b3c..0c65382 100644 --- a/assets/wasm/r/r_bg.wasm.d.ts +++ b/assets/wasm/r/r_bg.wasm.d.ts @@ -1,13 +1,6 @@ /* tslint:disable */ /* eslint-disable */ export const memory: WebAssembly.Memory; -export function __wbg_cli_free(a: number): void; -export function __wbg_get_cli_locale(a: number): number; -export function __wbg_set_cli_locale(a: number, b: number): void; -export function __wbg_get_cli_warranty(a: number): number; -export function __wbg_set_cli_warranty(a: number, b: number): void; -export function __wbg_get_cli_experiments(a: number, b: number): void; -export function __wbg_set_cli_experiments(a: number, b: number, c: number): void; export function __wbg_parseerror_free(a: number): void; export function parseerror_start(a: number): number; export function parseerror_end(a: number): number; @@ -16,6 +9,13 @@ export function wasm_session_header(a: number, b: number): void; export function wasm_runtime(a: number): number; export function wasm_parse_errors(a: number, b: number, c: number, d: number): void; export function wasm_highlight(a: number, b: number, c: number, d: number): void; +export function __wbg_cli_free(a: number): void; +export function __wbg_get_cli_locale(a: number): number; +export function __wbg_set_cli_locale(a: number, b: number): void; +export function __wbg_get_cli_warranty(a: number): number; +export function __wbg_set_cli_warranty(a: number, b: number): void; +export function __wbg_get_cli_experiments(a: number, b: number): void; +export function __wbg_set_cli_experiments(a: number, b: number, c: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; diff --git a/docs/r/callable/core/index.html b/docs/r/callable/core/index.html index 35ab9fe..61b6717 100644 --- a/docs/r/callable/core/index.html +++ b/docs/r/callable/core/index.html @@ -31,4 +31,4 @@ }) -