porffor 0.2.0-e562242 → 0.2.0-e62542f
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/CONTRIBUTING.md +254 -0
- package/LICENSE +20 -20
- package/README.md +150 -89
- package/asur/README.md +2 -0
- package/asur/index.js +1262 -0
- package/byg/index.js +237 -0
- package/compiler/2c.js +317 -72
- package/compiler/{sections.js → assemble.js} +63 -15
- package/compiler/builtins/annexb_string.js +72 -0
- package/compiler/builtins/annexb_string.ts +18 -0
- package/compiler/builtins/array.ts +145 -0
- package/compiler/builtins/base64.ts +76 -0
- package/compiler/builtins/crypto.ts +120 -0
- package/compiler/builtins/date.ts +2071 -0
- package/compiler/builtins/escape.ts +141 -0
- package/compiler/builtins/int.ts +147 -0
- package/compiler/builtins/number.ts +527 -0
- package/compiler/builtins/porffor.d.ts +59 -0
- package/compiler/builtins/string.ts +1055 -0
- package/compiler/builtins/tostring.ts +45 -0
- package/compiler/builtins.js +580 -272
- package/compiler/{codeGen.js → codegen.js} +1173 -428
- package/compiler/decompile.js +3 -4
- package/compiler/embedding.js +22 -22
- package/compiler/encoding.js +108 -10
- package/compiler/generated_builtins.js +1481 -0
- package/compiler/index.js +36 -34
- package/compiler/log.js +6 -3
- package/compiler/opt.js +51 -36
- package/compiler/parse.js +33 -23
- package/compiler/precompile.js +128 -0
- package/compiler/prefs.js +27 -0
- package/compiler/prototype.js +182 -42
- package/compiler/types.js +37 -0
- package/compiler/wasmSpec.js +30 -7
- package/compiler/wrap.js +141 -43
- package/package.json +9 -5
- package/porf +4 -0
- package/rhemyn/compile.js +46 -27
- package/rhemyn/parse.js +322 -320
- package/rhemyn/test/parse.js +58 -58
- package/runner/compare.js +34 -34
- package/runner/debug.js +122 -0
- package/runner/index.js +91 -11
- package/runner/profiler.js +102 -0
- package/runner/repl.js +42 -9
- package/runner/sizes.js +37 -37
- package/compiler/builtins/base64.js +0 -92
- package/node_trace.1.log +0 -1
- package/runner/info.js +0 -89
- package/runner/profile.js +0 -46
- package/runner/results.json +0 -1
- package/runner/transform.js +0 -15
- package/util/enum.js +0 -20
@@ -0,0 +1,45 @@
|
|
1
|
+
// // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
|
2
|
+
|
3
|
+
export const __Boolean_prototype_toString = (_this: boolean) => {
|
4
|
+
let out: bytestring = '';
|
5
|
+
if (_this) out = 'true';
|
6
|
+
else out = 'false';
|
7
|
+
|
8
|
+
return out;
|
9
|
+
};
|
10
|
+
|
11
|
+
export const __String_prototype_toString = (_this: string) => {
|
12
|
+
let out: string = Porffor.s``;
|
13
|
+
Porffor.clone(_this, out);
|
14
|
+
return out;
|
15
|
+
};
|
16
|
+
|
17
|
+
export const __ByteString_prototype_toString = (_this: bytestring) => {
|
18
|
+
let out: bytestring = Porffor.bs``;
|
19
|
+
Porffor.clone(_this, out);
|
20
|
+
return out;
|
21
|
+
};
|
22
|
+
|
23
|
+
// // export const __undefined_prototype_toString = (_this: number) => {
|
24
|
+
|
25
|
+
// // };
|
26
|
+
|
27
|
+
export const __Object_prototype_toString = (_this: object) => {
|
28
|
+
let out: bytestring = '[object Object]';
|
29
|
+
return out;
|
30
|
+
};
|
31
|
+
|
32
|
+
export const __Function_prototype_toString = (_this: Function) => {
|
33
|
+
// todo: actually use source
|
34
|
+
let out: bytestring = 'function () {}';
|
35
|
+
return out;
|
36
|
+
};
|
37
|
+
|
38
|
+
|
39
|
+
// // export const __Array_prototype_toString = (_this: any[]) => {
|
40
|
+
// // return _this.join();
|
41
|
+
// // };
|
42
|
+
|
43
|
+
// // export const __RegExp_prototype_toString = (_this: number) => {
|
44
|
+
|
45
|
+
// // };
|