@markw65/monkeyc-optimizer 1.1.31 → 1.1.33

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/README.md CHANGED
@@ -909,3 +909,30 @@ No functional change, just fixes a typo that broke the typescript exports.
909
909
  - Update getApiMapping to handle api.mir from sdk-6.2.0
910
910
  - Update various tests to work with sdk-6.2.0 (including marking one test as an expected failure)
911
911
  - Add a test to catch the export-project-using-barrels bug that was fixed in 1.1.30
912
+
913
+ ### 1.1.32
914
+
915
+ - Bug fixes
916
+
917
+ - Don't optimize `do { BODY } while (false);` to `{ BODY }` if `BODY` contains `break` or `continue`
918
+ - In some circumstances, a comparison between a known `Long` and a known `Char` could be inferred to be false, regardless of the values (eg `42l == '*'` which should be `true`). It would eventually be folded to the correct value, but in some circumstances, an incorrect warning could be issued, or an incorrect optimization could have already been performed.
919
+
920
+ - Fixes for sdk-6.2.x
921
+
922
+ - sdk-6.2.x fixes [this finally bug](https://forums.garmin.com/developer/connect-iq/i/bug-reports/finally-doesn-t-work-as-expected), so that now all the examples work correctly (ie the `finally` block always executes, as expected, no matter how you exit the `try` or `catch` blocks). I've updated the way the control flow graph is built to match this behavior.
923
+
924
+ - sdk-6.2.x fixes [this continue in switch issue](https://forums.garmin.com/developer/connect-iq/i/bug-reports/continue-in-a-switch-statement-behaves-surprisingly), by making `continue` in a `switch` continue the loop containing the switch (or its a compile time error if there's no loop). This matches the behavior of C and C++, for example. I've updated the optimizer to interpret `continue` appropriately, depending on the sdk version.
925
+
926
+ ### 1.1.33
927
+
928
+ - Update to [@markw65/prettier-plugin-monkeyc@1.0.51](https://github.com/markw65/prettier-plugin-monkeyc#1051)
929
+
930
+ - Makes it compatible with prettier@3.0.0
931
+
932
+ - Bug fixes
933
+
934
+ - Fix a problem that could incorrectly optimize an array-init
935
+
936
+ - Optimizations
937
+
938
+ - Enable the array-init optimization in a few more cases
package/build/api.cjs CHANGED
@@ -18,44 +18,44 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var api_exports = {};
20
20
  __export(api_exports, {
21
- checkCompilerVersion: () => import_chunk_6OD3V3XN.checkCompilerVersion,
22
- collectNamespaces: () => import_chunk_6OD3V3XN.collectNamespaces,
23
- createDocumentationMap: () => import_chunk_6OD3V3XN.createDocumentationMap,
24
- diagnostic: () => import_chunk_6OD3V3XN.diagnostic,
25
- diagnosticHelper: () => import_chunk_6OD3V3XN.diagnosticHelper,
26
- findNamesInScope: () => import_chunk_6OD3V3XN.findNamesInScope,
27
- findUsingForNode: () => import_chunk_6OD3V3XN.findUsingForNode,
28
- formatAst: () => import_chunk_6OD3V3XN.formatAst,
29
- formatAstLongLines: () => import_chunk_6OD3V3XN.formatAstLongLines,
30
- getApiFunctionInfo: () => import_chunk_6OD3V3XN.getApiFunctionInfo,
31
- getApiMapping: () => import_chunk_6OD3V3XN.getApiMapping,
32
- getSuperClasses: () => import_chunk_6OD3V3XN.getSuperClasses,
21
+ checkCompilerVersion: () => import_chunk_7ANQTFGD.checkCompilerVersion,
22
+ collectNamespaces: () => import_chunk_7ANQTFGD.collectNamespaces,
23
+ createDocumentationMap: () => import_chunk_7ANQTFGD.createDocumentationMap,
24
+ diagnostic: () => import_chunk_7ANQTFGD.diagnostic,
25
+ diagnosticHelper: () => import_chunk_7ANQTFGD.diagnosticHelper,
26
+ findNamesInScope: () => import_chunk_7ANQTFGD.findNamesInScope,
27
+ findUsingForNode: () => import_chunk_7ANQTFGD.findUsingForNode,
28
+ formatAst: () => import_chunk_7ANQTFGD.formatAst,
29
+ formatAstLongLines: () => import_chunk_7ANQTFGD.formatAstLongLines,
30
+ getApiFunctionInfo: () => import_chunk_7ANQTFGD.getApiFunctionInfo,
31
+ getApiMapping: () => import_chunk_7ANQTFGD.getApiMapping,
32
+ getSuperClasses: () => import_chunk_7ANQTFGD.getSuperClasses,
33
33
  hasProperty: () => import_chunk_MBTLUWXR.hasProperty,
34
- isClassVariable: () => import_chunk_6OD3V3XN.isClassVariable,
35
- isLocal: () => import_chunk_6OD3V3XN.isLocal,
36
- isLookupCandidate: () => import_chunk_6OD3V3XN.isLookupCandidate,
37
- isStateNode: () => import_chunk_6OD3V3XN.isStateNode,
38
- lookupByFullName: () => import_chunk_6OD3V3XN.lookupByFullName,
39
- lookupNext: () => import_chunk_6OD3V3XN.lookupNext,
40
- lookupResultContains: () => import_chunk_6OD3V3XN.lookupResultContains,
41
- lookupWithType: () => import_chunk_6OD3V3XN.lookupWithType,
42
- makeToyboxLink: () => import_chunk_6OD3V3XN.makeToyboxLink,
43
- mapVarDeclsByType: () => import_chunk_6OD3V3XN.mapVarDeclsByType,
44
- markInvokeClassMethod: () => import_chunk_6OD3V3XN.markInvokeClassMethod,
45
- parseSdkVersion: () => import_chunk_6OD3V3XN.parseSdkVersion,
46
- sameLookupResult: () => import_chunk_6OD3V3XN.sameLookupResult,
34
+ isClassVariable: () => import_chunk_7ANQTFGD.isClassVariable,
35
+ isLocal: () => import_chunk_7ANQTFGD.isLocal,
36
+ isLookupCandidate: () => import_chunk_7ANQTFGD.isLookupCandidate,
37
+ isStateNode: () => import_chunk_7ANQTFGD.isStateNode,
38
+ lookupByFullName: () => import_chunk_7ANQTFGD.lookupByFullName,
39
+ lookupNext: () => import_chunk_7ANQTFGD.lookupNext,
40
+ lookupResultContains: () => import_chunk_7ANQTFGD.lookupResultContains,
41
+ lookupWithType: () => import_chunk_7ANQTFGD.lookupWithType,
42
+ makeToyboxLink: () => import_chunk_7ANQTFGD.makeToyboxLink,
43
+ mapVarDeclsByType: () => import_chunk_7ANQTFGD.mapVarDeclsByType,
44
+ markInvokeClassMethod: () => import_chunk_7ANQTFGD.markInvokeClassMethod,
45
+ parseSdkVersion: () => import_chunk_7ANQTFGD.parseSdkVersion,
46
+ sameLookupResult: () => import_chunk_7ANQTFGD.sameLookupResult,
47
47
  traverseAst: () => import_chunk_MBTLUWXR.traverseAst,
48
- variableDeclarationName: () => import_chunk_6OD3V3XN.variableDeclarationName,
49
- visitReferences: () => import_chunk_6OD3V3XN.visitReferences,
50
- visit_resources: () => import_chunk_6OD3V3XN.visit_resources,
51
- visitorNode: () => import_chunk_6OD3V3XN.visitorNode
48
+ variableDeclarationName: () => import_chunk_7ANQTFGD.variableDeclarationName,
49
+ visitReferences: () => import_chunk_7ANQTFGD.visitReferences,
50
+ visit_resources: () => import_chunk_7ANQTFGD.visit_resources,
51
+ visitorNode: () => import_chunk_7ANQTFGD.visitorNode
52
52
  });
53
53
  module.exports = __toCommonJS(api_exports);
54
- var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.cjs");
54
+ var import_chunk_7ANQTFGD = require("./chunk-7ANQTFGD.cjs");
55
55
  var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
56
56
  var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
57
57
  var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
58
- (0, import_chunk_6OD3V3XN.init_api)();
58
+ (0, import_chunk_7ANQTFGD.init_api)();
59
59
  // Annotate the CommonJS export names for ESM import in node:
60
60
  0 && (module.exports = {
61
61
  checkCompilerVersion,
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_6OD3V3XN_exports = {};
30
- __export(chunk_6OD3V3XN_exports, {
29
+ var chunk_7ANQTFGD_exports = {};
30
+ __export(chunk_7ANQTFGD_exports, {
31
31
  EnumTagsConst: () => EnumTagsConst,
32
32
  LastTypeTag: () => LastTypeTag,
33
33
  ObjectLikeTagsConst: () => ObjectLikeTagsConst,
@@ -122,7 +122,7 @@ __export(chunk_6OD3V3XN_exports, {
122
122
  visitorNode: () => visitorNode,
123
123
  xml_util_exports: () => xml_util_exports
124
124
  });
125
- module.exports = __toCommonJS(chunk_6OD3V3XN_exports);
125
+ module.exports = __toCommonJS(chunk_7ANQTFGD_exports);
126
126
  var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
127
127
  var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
128
128
  var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
@@ -8899,6 +8899,9 @@ function buildReducedGraph(state, func, refsForUpdate, notice) {
8899
8899
  case "TryStatement": {
8900
8900
  const top = localState.push(node);
8901
8901
  const catches = top.throw = {};
8902
+ if (node.finalizer) {
8903
+ top.finally = {};
8904
+ }
8902
8905
  localState.addEdge(localState.curBlock, top.throw);
8903
8906
  localState.newBlock();
8904
8907
  tryActive++;
@@ -8907,43 +8910,37 @@ function buildReducedGraph(state, func, refsForUpdate, notice) {
8907
8910
  delete top.throw;
8908
8911
  top.posttry = {};
8909
8912
  const tryFallsThrough = !localState.unreachable;
8910
- if (node.finalizer) {
8911
- tryActive++;
8912
- top.throw = top.finally = {};
8913
- localState.addEdge(localState.curBlock, top.finally);
8914
- } else {
8915
- if (!localState.unreachable) {
8916
- localState.addEdge(localState.curBlock, top.posttry);
8917
- }
8913
+ if (tryFallsThrough) {
8914
+ localState.addEdge(localState.curBlock, top.finally ?? top.posttry);
8918
8915
  }
8919
8916
  localState.unreachable = true;
8920
8917
  localState.newBlock(catches);
8921
8918
  if (node.handler) {
8922
8919
  state.traverse(node.handler);
8923
- if (top.throw) {
8924
- tryActive--;
8925
- delete top.throw;
8926
- }
8927
8920
  if (localState.curBlock.preds) {
8928
8921
  localState.terminal("ThrowStatement");
8929
8922
  }
8930
8923
  }
8931
- if (top.throw) {
8932
- tryActive--;
8933
- delete top.throw;
8934
- }
8935
8924
  if (node.finalizer) {
8936
8925
  localState.unreachable = true;
8937
8926
  localState.newBlock(top.finally);
8938
8927
  delete top.finally;
8939
8928
  state.traverse(node.finalizer);
8940
- if (tryFallsThrough && !localState.unreachable) {
8941
- localState.addEdge(localState.curBlock, top.posttry);
8929
+ if (!localState.unreachable) {
8930
+ if (tryFallsThrough) {
8931
+ localState.addEdge(localState.curBlock, top.posttry);
8932
+ }
8933
+ top.postfinally?.forEach(
8934
+ (post2) => localState.addEdge(localState.curBlock, post2)
8935
+ );
8942
8936
  }
8943
8937
  localState.terminal("ThrowStatement");
8944
8938
  }
8945
8939
  localState.unreachable = true;
8946
8940
  localState.newBlock(top.posttry);
8941
+ if (!top.posttry.preds) {
8942
+ localState.unreachable = true;
8943
+ }
8947
8944
  return [];
8948
8945
  }
8949
8946
  case "CatchClause": {
@@ -8958,13 +8955,11 @@ function buildReducedGraph(state, func, refsForUpdate, notice) {
8958
8955
  localState.newBlock();
8959
8956
  }
8960
8957
  state.traverse(node.body);
8961
- if (top.finally) {
8962
- localState.addEdge(localState.curBlock, top.finally);
8963
- }
8964
8958
  if (!localState.unreachable) {
8965
- if (!top.posttry)
8966
- top.posttry = {};
8967
- localState.addEdge(localState.curBlock, top.posttry);
8959
+ localState.addEdge(
8960
+ localState.curBlock,
8961
+ top.finally ?? top.posttry
8962
+ );
8968
8963
  }
8969
8964
  localState.unreachable = true;
8970
8965
  localState.newBlock(next);
@@ -9352,13 +9347,29 @@ var init_control_flow = (0, import_chunk_ABYVSU2C.__esm)({
9352
9347
  }
9353
9348
  terminal(type) {
9354
9349
  const re = Terminals[type];
9355
- if (re) {
9356
- for (let i = this.stack.length; i--; ) {
9357
- const target = this.stack[i][re];
9358
- if (target) {
9359
- this.addEdge(this.curBlock, target);
9360
- break;
9350
+ let finalies = null;
9351
+ for (let i = this.stack.length; i--; ) {
9352
+ const fin = this.stack[i].finally;
9353
+ if (fin && (re !== "throw" || !this.stack[i].throw)) {
9354
+ this.addEdge(this.curBlock, fin);
9355
+ if (!finalies) {
9356
+ finalies = /* @__PURE__ */ new Set();
9361
9357
  }
9358
+ finalies.add(i);
9359
+ }
9360
+ if (!re)
9361
+ continue;
9362
+ const target = this.stack[i][re];
9363
+ if (target) {
9364
+ this.addEdge(this.curBlock, target);
9365
+ finalies?.forEach((i2) => {
9366
+ const elm = this.stack[i2];
9367
+ if (!elm.postfinally) {
9368
+ elm.postfinally = /* @__PURE__ */ new Set();
9369
+ }
9370
+ elm.postfinally.add(target);
9371
+ });
9372
+ break;
9362
9373
  }
9363
9374
  }
9364
9375
  this.unreachable = true;
@@ -10063,7 +10074,7 @@ function restrictExactTypesByEquality(a, b) {
10063
10074
  };
10064
10075
  if (value_bits && !(value_bits & value_bits - 1)) {
10065
10076
  if (a.value != null) {
10066
- v.value = value_bits === 16 ? BigInt(a.value) : Number(a.value);
10077
+ v.value = value_bits === 128 ? String.fromCharCode(Number(a.value)) : value_bits === 16 ? BigInt(a.value) : Number(a.value);
10067
10078
  if (b.value && !couldBe(v, b)) {
10068
10079
  v.type = 0;
10069
10080
  delete v.value;
@@ -16720,9 +16731,46 @@ function beforeEvaluate(istate, node) {
16720
16731
  case "WhileStatement":
16721
16732
  case "DoWhileStatement": {
16722
16733
  const test = popIstate(istate, node.test);
16723
- if (!test.embeddedEffects) {
16724
- if (mustBeFalse(test.value)) {
16725
- return node.type === "WhileStatement" ? false : node.body;
16734
+ if (!test.embeddedEffects && mustBeFalse(test.value)) {
16735
+ if (node.type === "WhileStatement") {
16736
+ return false;
16737
+ }
16738
+ let ok = true;
16739
+ let switchDepth = 0;
16740
+ (0, import_chunk_MBTLUWXR.traverseAst)(
16741
+ node.body,
16742
+ (n) => {
16743
+ if (!ok)
16744
+ return false;
16745
+ switch (n.type) {
16746
+ case "DoWhileStatement":
16747
+ case "WhileStatement":
16748
+ case "ForStatement":
16749
+ return false;
16750
+ case "SwitchStatement":
16751
+ if ((istate.state.sdkVersion ?? 0) < 6002e3) {
16752
+ return false;
16753
+ }
16754
+ switchDepth++;
16755
+ break;
16756
+ case "BreakStatement":
16757
+ if (switchDepth) {
16758
+ break;
16759
+ }
16760
+ case "ContinueStatement":
16761
+ ok = false;
16762
+ break;
16763
+ }
16764
+ return null;
16765
+ },
16766
+ (n) => {
16767
+ if (n.type === "SwitchStatement") {
16768
+ switchDepth--;
16769
+ }
16770
+ }
16771
+ );
16772
+ if (ok) {
16773
+ return node.body;
16726
16774
  }
16727
16775
  }
16728
16776
  istate.stack.push(test);
@@ -22514,6 +22562,7 @@ function optimizeArrayInit(func, block, index, context, interpState) {
22514
22562
  interpState = cloneState2(null);
22515
22563
  }
22516
22564
  const putvStarts = [];
22565
+ const dupsToFix = [];
22517
22566
  let i;
22518
22567
  let initInst = null;
22519
22568
  let initType = null;
@@ -22546,6 +22595,12 @@ function optimizeArrayInit(func, block, index, context, interpState) {
22546
22595
  usedLocals |= 1n << BigInt(bc.arg);
22547
22596
  }
22548
22597
  const delta = interpState.stack.length - depth;
22598
+ if (delta < 0) {
22599
+ break;
22600
+ }
22601
+ if (bc.op === 46 && bc.arg >= delta - 1) {
22602
+ dupsToFix[k] = putvStarts.length;
22603
+ }
22549
22604
  if (delta === 3) {
22550
22605
  const t = interpState.stack[interpState.stack.length - 1].type;
22551
22606
  if (bc.op === 18) {
@@ -22559,9 +22614,6 @@ function optimizeArrayInit(func, block, index, context, interpState) {
22559
22614
  }
22560
22615
  thisInit = null;
22561
22616
  }
22562
- if (delta < 0 || bc.op === 46 && bc.arg >= delta - 1) {
22563
- break;
22564
- }
22565
22617
  }
22566
22618
  if (found === i)
22567
22619
  break;
@@ -22629,6 +22681,11 @@ function optimizeArrayInit(func, block, index, context, interpState) {
22629
22681
  /* aputv */
22630
22682
  );
22631
22683
  };
22684
+ dupsToFix.forEach((x, n) => {
22685
+ const bc = block.bytecodes[n];
22686
+ (0, import_node_assert9.default)(bc.op === 46 && bc.arg >= 2);
22687
+ bc.arg -= 2;
22688
+ });
22632
22689
  convertAputv(i - 1);
22633
22690
  for (let i2 = putvStarts.length; i2--; ) {
22634
22691
  const offset = putvStarts[i2];
@@ -22748,6 +22805,11 @@ ${blockToString(block, context)}`
22748
22805
  if (local >= 0) {
22749
22806
  block.bytecodes.splice(i, 0, bytecode(2, void 0));
22750
22807
  }
22808
+ dupsToFix.forEach((x, n) => {
22809
+ const bc = block.bytecodes[n];
22810
+ (0, import_node_assert9.default)(bc.op === 46 && bc.arg >= 2);
22811
+ bc.arg += (putvStarts.length - x - 1) * 2;
22812
+ });
22751
22813
  for (let i2 = putvStarts.length; i2-- > 1; ) {
22752
22814
  block.bytecodes.splice(putvStarts[i2], 2);
22753
22815
  }
@@ -29836,18 +29898,22 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
29836
29898
  if (hasTests != null && !config.checkBuildPragmas && configOptionsToCheck.every(
29837
29899
  (option) => prevOptions[option] === config[option]
29838
29900
  ) && actualOptimizedFiles.length === mcFiles.length && mcFiles.map((v) => v.output).sort().every((f, i) => f === actualOptimizedFiles[i])) {
29839
- const source_time = await (0, import_chunk_PVBIKZYZ.last_modified)(
29840
- Object.keys(fnMap).concat(dependencyFiles)
29841
- );
29842
- const opt_time = await (0, import_chunk_PVBIKZYZ.first_modified)(
29843
- Object.values(fnMap).map((v) => v.output)
29844
- );
29845
- if (source_time < opt_time && 1687277028413 < opt_time) {
29846
- return {
29847
- hasTests,
29848
- diagnostics: prevDiagnostics,
29849
- sdkVersion: prevSdkVersion
29850
- };
29901
+ const sdk = await getSdkPath();
29902
+ const match = sdk.match(/-(\d+\.\d+\.\d+)/);
29903
+ if ((match && parseSdkVersion(match[1])) === prevSdkVersion) {
29904
+ const source_time = await (0, import_chunk_PVBIKZYZ.last_modified)(
29905
+ Object.keys(fnMap).concat(dependencyFiles)
29906
+ );
29907
+ const opt_time = await (0, import_chunk_PVBIKZYZ.first_modified)(
29908
+ Object.values(fnMap).map((v) => v.output)
29909
+ );
29910
+ if (source_time < opt_time && 1690936956222 < opt_time) {
29911
+ return {
29912
+ hasTests,
29913
+ diagnostics: prevDiagnostics,
29914
+ sdkVersion: prevSdkVersion
29915
+ };
29916
+ }
29851
29917
  }
29852
29918
  }
29853
29919
  const [, , prettierConfig] = await Promise.all([
@@ -29879,7 +29945,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
29879
29945
  hasTests: hasTests2,
29880
29946
  diagnostics,
29881
29947
  sdkVersion,
29882
- optimizerVersion: "1.1.31",
29948
+ optimizerVersion: "1.1.33",
29883
29949
  ...Object.fromEntries(
29884
29950
  configOptionsToCheck.map((option) => [option, config[option]])
29885
29951
  )
@@ -18,29 +18,29 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var optimizer_exports = {};
20
20
  __export(optimizer_exports, {
21
- StateNodeAttributes: () => import_chunk_6OD3V3XN.StateNodeAttributes,
22
- buildOptimizedProject: () => import_chunk_6OD3V3XN.buildOptimizedProject,
21
+ StateNodeAttributes: () => import_chunk_7ANQTFGD.StateNodeAttributes,
22
+ buildOptimizedProject: () => import_chunk_7ANQTFGD.buildOptimizedProject,
23
23
  copyRecursiveAsNeeded: () => import_chunk_PVBIKZYZ.copyRecursiveAsNeeded,
24
- defaultConfig: () => import_chunk_6OD3V3XN.defaultConfig,
25
- display: () => import_chunk_6OD3V3XN.display,
26
- generateApiMirTests: () => import_chunk_6OD3V3XN.generateApiMirTests,
27
- generateOneConfig: () => import_chunk_6OD3V3XN.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_6OD3V3XN.generateOptimizedProject,
29
- getConfig: () => import_chunk_6OD3V3XN.getConfig,
30
- getProjectAnalysis: () => import_chunk_6OD3V3XN.getProjectAnalysis,
31
- get_jungle: () => import_chunk_6OD3V3XN.get_jungle,
32
- isErrorWithLocation: () => import_chunk_6OD3V3XN.isErrorWithLocation,
33
- launchSimulator: () => import_chunk_6OD3V3XN.launchSimulator,
34
- manifestProducts: () => import_chunk_6OD3V3XN.manifestProducts,
35
- mctree: () => import_chunk_6OD3V3XN.mctree,
36
- simulateProgram: () => import_chunk_6OD3V3XN.simulateProgram
24
+ defaultConfig: () => import_chunk_7ANQTFGD.defaultConfig,
25
+ display: () => import_chunk_7ANQTFGD.display,
26
+ generateApiMirTests: () => import_chunk_7ANQTFGD.generateApiMirTests,
27
+ generateOneConfig: () => import_chunk_7ANQTFGD.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_7ANQTFGD.generateOptimizedProject,
29
+ getConfig: () => import_chunk_7ANQTFGD.getConfig,
30
+ getProjectAnalysis: () => import_chunk_7ANQTFGD.getProjectAnalysis,
31
+ get_jungle: () => import_chunk_7ANQTFGD.get_jungle,
32
+ isErrorWithLocation: () => import_chunk_7ANQTFGD.isErrorWithLocation,
33
+ launchSimulator: () => import_chunk_7ANQTFGD.launchSimulator,
34
+ manifestProducts: () => import_chunk_7ANQTFGD.manifestProducts,
35
+ mctree: () => import_chunk_7ANQTFGD.mctree,
36
+ simulateProgram: () => import_chunk_7ANQTFGD.simulateProgram
37
37
  });
38
38
  module.exports = __toCommonJS(optimizer_exports);
39
- var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.cjs");
39
+ var import_chunk_7ANQTFGD = require("./chunk-7ANQTFGD.cjs");
40
40
  var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
41
41
  var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
42
42
  var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
43
- (0, import_chunk_6OD3V3XN.init_optimizer)();
43
+ (0, import_chunk_7ANQTFGD.init_optimizer)();
44
44
  // Annotate the CommonJS export names for ESM import in node:
45
45
  0 && (module.exports = {
46
46
  StateNodeAttributes,
@@ -18,25 +18,25 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var sdk_util_exports = {};
20
20
  __export(sdk_util_exports, {
21
- SectionKinds: () => import_chunk_6OD3V3XN.SectionKinds,
22
- appSupport: () => import_chunk_6OD3V3XN.appSupport,
23
- connectiq: () => import_chunk_6OD3V3XN.connectiq,
24
- getDeviceInfo: () => import_chunk_6OD3V3XN.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_6OD3V3XN.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_6OD3V3XN.getLanguages,
27
- getSdkPath: () => import_chunk_6OD3V3XN.getSdkPath,
28
- isWin: () => import_chunk_6OD3V3XN.isWin,
29
- optimizeProgram: () => import_chunk_6OD3V3XN.optimizeProgram,
30
- readPrg: () => import_chunk_6OD3V3XN.readPrg,
31
- readPrgWithOffsets: () => import_chunk_6OD3V3XN.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_6OD3V3XN.xml_util_exports
21
+ SectionKinds: () => import_chunk_7ANQTFGD.SectionKinds,
22
+ appSupport: () => import_chunk_7ANQTFGD.appSupport,
23
+ connectiq: () => import_chunk_7ANQTFGD.connectiq,
24
+ getDeviceInfo: () => import_chunk_7ANQTFGD.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_7ANQTFGD.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_7ANQTFGD.getLanguages,
27
+ getSdkPath: () => import_chunk_7ANQTFGD.getSdkPath,
28
+ isWin: () => import_chunk_7ANQTFGD.isWin,
29
+ optimizeProgram: () => import_chunk_7ANQTFGD.optimizeProgram,
30
+ readPrg: () => import_chunk_7ANQTFGD.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_7ANQTFGD.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_7ANQTFGD.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.cjs");
35
+ var import_chunk_7ANQTFGD = require("./chunk-7ANQTFGD.cjs");
36
36
  var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
37
37
  var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
38
38
  var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
39
- (0, import_chunk_6OD3V3XN.init_sdk_util)();
39
+ (0, import_chunk_7ANQTFGD.init_sdk_util)();
40
40
  // Annotate the CommonJS export names for ESM import in node:
41
41
  0 && (module.exports = {
42
42
  SectionKinds,
@@ -14,6 +14,7 @@ export type RemoteProject = string | {
14
14
  jungleContent?: string[];
15
15
  garminOptLevel?: number;
16
16
  test?: boolean | string[];
17
+ branch?: string;
17
18
  };
18
19
  export declare const githubProjects: RemoteProject[];
19
20
  export declare function fetchGitProjects(projects: RemoteProject[], testOnly: boolean, skipRemote: boolean): Promise<(string | {
@@ -21,17 +21,17 @@ __export(worker_thread_exports, {
21
21
  default: () => worker_thread_default
22
22
  });
23
23
  module.exports = __toCommonJS(worker_thread_exports);
24
- var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.cjs");
24
+ var import_chunk_7ANQTFGD = require("./chunk-7ANQTFGD.cjs");
25
25
  var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
26
26
  var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
27
27
  var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
28
28
  var import_node_worker_threads = require("node:worker_threads");
29
29
  var require_worker_thread = (0, import_chunk_ABYVSU2C.__commonJS)({
30
30
  "src/worker-thread.ts"() {
31
- (0, import_chunk_6OD3V3XN.init_worker_task)();
31
+ (0, import_chunk_7ANQTFGD.init_worker_task)();
32
32
  if (import_node_worker_threads.parentPort) {
33
33
  import_node_worker_threads.parentPort.on("message", async (task) => {
34
- return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_6OD3V3XN.performTask)(task));
34
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_7ANQTFGD.performTask)(task));
35
35
  });
36
36
  }
37
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@markw65/monkeyc-optimizer",
3
3
  "type": "commonjs",
4
- "version": "1.1.31",
4
+ "version": "1.1.33",
5
5
  "description": "Source to source optimizer for Garmin Monkey C code",
6
6
  "main": "build/optimizer.cjs",
7
7
  "types": "build/src/optimizer.d.ts",
@@ -48,7 +48,7 @@
48
48
  "author": "markw65",
49
49
  "license": "MIT",
50
50
  "dependencies": {
51
- "@markw65/prettier-plugin-monkeyc": "^1.0.49"
51
+ "@markw65/prettier-plugin-monkeyc": "^1.0.51"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/chai": "^4.3.4",