porffor 0.2.0-cb647c8 → 0.2.0-de394c3

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.
Files changed (55) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +114 -63
  3. package/asur/README.md +2 -0
  4. package/asur/index.js +1262 -0
  5. package/byg/index.js +237 -0
  6. package/compiler/2c.js +1 -1
  7. package/compiler/{sections.js → assemble.js} +63 -15
  8. package/compiler/builtins/annexb_string.js +72 -0
  9. package/compiler/builtins/annexb_string.ts +19 -0
  10. package/compiler/builtins/array.ts +145 -0
  11. package/compiler/builtins/base64.ts +105 -22
  12. package/compiler/builtins/crypto.ts +120 -0
  13. package/compiler/builtins/date.ts +1370 -0
  14. package/compiler/builtins/escape.ts +141 -0
  15. package/compiler/builtins/int.ts +147 -0
  16. package/compiler/builtins/number.ts +527 -0
  17. package/compiler/builtins/porffor.d.ts +41 -1
  18. package/compiler/builtins/string.ts +1055 -0
  19. package/compiler/builtins/tostring.ts +45 -0
  20. package/compiler/builtins.js +455 -243
  21. package/compiler/{codeGen.js → codegen.js} +912 -337
  22. package/compiler/embedding.js +22 -22
  23. package/compiler/encoding.js +108 -10
  24. package/compiler/generated_builtins.js +1262 -0
  25. package/compiler/index.js +25 -29
  26. package/compiler/log.js +6 -3
  27. package/compiler/opt.js +50 -36
  28. package/compiler/parse.js +35 -27
  29. package/compiler/precompile.js +123 -0
  30. package/compiler/prefs.js +26 -0
  31. package/compiler/prototype.js +13 -28
  32. package/compiler/types.js +37 -0
  33. package/compiler/wasmSpec.js +28 -8
  34. package/compiler/wrap.js +51 -47
  35. package/fib.js +7 -0
  36. package/package.json +9 -5
  37. package/porf +2 -0
  38. package/rhemyn/compile.js +5 -3
  39. package/rhemyn/parse.js +323 -320
  40. package/rhemyn/test/parse.js +58 -58
  41. package/runner/compare.js +34 -34
  42. package/runner/debug.js +122 -0
  43. package/runner/index.js +48 -9
  44. package/runner/profiler.js +102 -0
  45. package/runner/repl.js +40 -7
  46. package/runner/sizes.js +37 -37
  47. package/demo.js +0 -3
  48. package/demo.ts +0 -1
  49. package/filesize.cmd +0 -2
  50. package/runner/info.js +0 -89
  51. package/runner/profile.js +0 -46
  52. package/runner/results.json +0 -1
  53. package/runner/transform.js +0 -15
  54. package/tmp.c +0 -1248
  55. package/util/enum.js +0 -20
package/util/enum.js DELETED
@@ -1,20 +0,0 @@
1
- export const enumify = (...args) => {
2
- const obj = {};
3
-
4
- for (let i = 0; i < args.length; i++) {
5
- obj[i] = args[i];
6
- obj[args[i]] = i;
7
- }
8
-
9
- return obj;
10
- };
11
-
12
- // a procedural enum ;)
13
- export const procEnum = () => {
14
- let n = 0;
15
- return new Proxy({}, {
16
- get(target, p) {
17
- return target[p] ?? (target[p] = n++);
18
- }
19
- });
20
- };