@harmoniclabs/pebble 0.1.3-dev1 → 0.1.3-dev2

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 (34) hide show
  1. package/dist/IR/tree_utils/intToUtf8Bytes.d.ts +8 -0
  2. package/dist/IR/tree_utils/intToUtf8Bytes.js +49 -0
  3. package/dist/ast/nodes/statements/PebbleStmt.d.ts +2 -1
  4. package/dist/ast/nodes/statements/PebbleStmt.js +2 -0
  5. package/dist/ast/nodes/statements/TraceStmt.d.ts +11 -0
  6. package/dist/ast/nodes/statements/TraceStmt.js +10 -0
  7. package/dist/compiler/AstCompiler/AstCompiler.d.ts +11 -0
  8. package/dist/compiler/AstCompiler/AstCompiler.js +185 -0
  9. package/dist/compiler/AstCompiler/internal/_deriveContractBody/_deriveContractBody.js +8 -0
  10. package/dist/compiler/AstCompiler/internal/statements/_compileStatement.js +4 -0
  11. package/dist/compiler/AstCompiler/internal/statements/_compileTraceStmt.d.ts +4 -0
  12. package/dist/compiler/AstCompiler/internal/statements/_compileTraceStmt.js +15 -0
  13. package/dist/compiler/Compiler.d.ts +5 -0
  14. package/dist/compiler/Compiler.js +25 -1
  15. package/dist/compiler/TirCompiler/expressify/determineReassignedVariablesAndReturn.js +5 -3
  16. package/dist/compiler/TirCompiler/expressify/expressify.js +8 -0
  17. package/dist/compiler/TirCompiler/expressify/expressifyIfBranch.js +2 -0
  18. package/dist/compiler/TirCompiler/expressify/expressifyVars.js +10 -1
  19. package/dist/compiler/tir/expressions/TirExpr.d.ts +2 -1
  20. package/dist/compiler/tir/expressions/TirExpr.js +2 -0
  21. package/dist/compiler/tir/expressions/TirTraceExpr.d.ts +22 -0
  22. package/dist/compiler/tir/expressions/TirTraceExpr.js +53 -0
  23. package/dist/compiler/tir/expressions/TirTypeConversionExpr.js +6 -0
  24. package/dist/compiler/tir/statements/TirStmt.d.ts +2 -1
  25. package/dist/compiler/tir/statements/TirStmt.js +2 -0
  26. package/dist/compiler/tir/statements/TirTraceStmt.d.ts +15 -0
  27. package/dist/compiler/tir/statements/TirTraceStmt.js +20 -0
  28. package/dist/parser/Parser.d.ts +2 -0
  29. package/dist/parser/Parser.js +15 -0
  30. package/dist/tokenizer/Token.d.ts +82 -81
  31. package/dist/tokenizer/Token.js +82 -81
  32. package/dist/tokenizer/utils/tokenFromKeyword.js +2 -0
  33. package/dist/utils/array/keepSortedArrInplace.js +15 -0
  34. package/package.json +1 -1
@@ -23,6 +23,21 @@ export function keepSortedStrArrInplace(target, source) {
23
23
  }
24
24
  continue; // element is in source, check next without removing this
25
25
  }
26
+ // elem > fstSrc: source has elements not in target, advance source
27
+ if (elem > fstSrc) {
28
+ while (source.length > 0 && fstSrc < elem) {
29
+ fstSrc = source.shift();
30
+ }
31
+ if (fstSrc === elem) {
32
+ fstSrc = source.shift();
33
+ if (!fstSrc) {
34
+ target.length = i + 1;
35
+ return target;
36
+ }
37
+ continue;
38
+ }
39
+ // fstSrc > elem or source exhausted: elem not in source, fall through to remove
40
+ }
26
41
  // not equal, remove the element
27
42
  target.splice(i, 1);
28
43
  i--; // adjust index since we removed an element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmoniclabs/pebble",
3
- "version": "0.1.3-dev1",
3
+ "version": "0.1.3-dev2",
4
4
  "description": "A simple, yet rock solid, functional language with an imperative bias, targeting UPLC",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",