@markw65/monkeyc-optimizer 1.1.92 → 1.1.93

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to the "monkeyc-optimizer" package will be documented in this file.
4
4
 
5
+ ### 1.1.93
6
+
7
+ - Update to [@markw65/prettier-plugin-monkeyc@1.0.64](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1064)
8
+ - Fixes incompatibilities with `prettier@3.7.0` and later
9
+ - Update to prettier3.x for testing/development purposes, since that's what's in use almost everywhere now
10
+ - Add support for Extended Code Spaces in the post build optimizer.
11
+ - This just fixes some assertions, and makes sure that various tables get updated correctly. It doesn't yet optimize the code in the Extended Code Space.
12
+
5
13
  ### 1.1.92
6
14
 
7
15
  - Get rid of yazl, yauzl and extract-zip, and uze 7z-wasm instead.
@@ -26,7 +34,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
26
34
  - Fix output of cft-font-info
27
35
  - When I refactored the code to avoid holding everything in memory at once, I inadvertently changed the format. This restores the original format, and adds a flag to enable the incorrect format, just in case someone's relying on it.
28
36
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.61](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1061)
29
-
30
37
  - Allow semi-colons after expression-statements, and uncontrolled block-statements to match Garmin's parser.
31
38
 
32
39
  - Fix a crash when no valid products are found in the manifest (Fixes [prettier-extension-monkeyc#19](https://github.com/markw65/prettier-extension-monkeyc/issues/19))
@@ -118,7 +125,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
118
125
  ### 1.1.72
119
126
 
120
127
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.59](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1059)
121
-
122
128
  - Ignore `resolveType` field in serializeMonkeyC to avoid errors due to cycles.
123
129
 
124
130
  - Make `evaluate` skip everything except the `body` when processing class, module or function declarations.
@@ -308,7 +314,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
308
314
  ### 1.1.39
309
315
 
310
316
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.54](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1054)
311
-
312
317
  - Fixes the parser to understand tuples
313
318
 
314
319
  - Add basic type analysis for tuples
@@ -323,23 +328,19 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
323
328
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.53](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1053)
324
329
 
325
330
  - Features
326
-
327
331
  - Generate diagnostics for unary and binary operators with incorrect arguments
328
332
  - Properly handle object-literal types (eg `{ :foo as String, :bar as Number }`).
329
333
  - When converting Graphics.ColorValue to a number, format the number as hex.
330
334
 
331
335
  - Tests
332
-
333
336
  - Update tests for sdk 6.3.0
334
337
  - Add more test coverage for binary operators and their expected types.
335
338
 
336
339
  - Build
337
-
338
340
  - Use [@markw65/peggy-optimizer](https://github.com/markw65/peggy/tree/peggy-optimizer/optimizer-plugin) to optimize the jungle and resource parsers
339
341
  - Make things work properly with prettier-3.x, but don't actually upgrade yet
340
342
 
341
343
  - Bug fixes
342
-
343
344
  - Fix a bug with the result type of A & B when A could be Boolean
344
345
  - Always include null for the types of values extracted from `Dictionary`s
345
346
  - When inferring the type of a `Dictionary`, don't include values.
@@ -352,7 +353,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
352
353
  ### 1.1.35
353
354
 
354
355
  - Infrastructure
355
-
356
356
  - Optimize the xml parser to speed up compilation/analysis
357
357
 
358
358
  - Type Checker
@@ -361,7 +361,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
361
361
  ### 1.1.34
362
362
 
363
363
  - Optimizations
364
-
365
364
  - Add a few more peephole optimizations to the post build optimizer
366
365
  - `incsp 0;` => `nop`
367
366
  - `ipush 0; shlv` => `nop`
@@ -375,26 +374,21 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
375
374
  ### 1.1.33
376
375
 
377
376
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.51](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1051)
378
-
379
377
  - Makes it compatible with prettier@3.0.0
380
378
 
381
379
  - Bug fixes
382
-
383
380
  - Fix a problem that could incorrectly optimize an array-init
384
381
 
385
382
  - Optimizations
386
-
387
383
  - Enable the array-init optimization in a few more cases
388
384
 
389
385
  ### 1.1.32
390
386
 
391
387
  - Bug fixes
392
-
393
388
  - Don't optimize `do { BODY } while (false);` to `{ BODY }` if `BODY` contains `break` or `continue`
394
389
  - 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.
395
390
 
396
391
  - Fixes for sdk-6.2.x
397
-
398
392
  - 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.
399
393
 
400
394
  - 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.
@@ -415,7 +409,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
415
409
  ### 1.1.29
416
410
 
417
411
  - Bug fixes
418
-
419
412
  - Fixes an issue where a value could incorrectly be inferred to be true-ish when its declared type was known to be an object of class type. This is not of itself incorrect, but some Toybox APIs are declared as returning an Object of a class, but may in fact return null - so we can't treat them as non-null.
420
413
 
421
414
  - Enhancements
@@ -424,7 +417,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
424
417
  ### 1.1.28
425
418
 
426
419
  - Bug fixes
427
-
428
420
  - Fixes an issue in the post build optimizer which could cause a pre-definition to be inserted just prior to an `frpush`, which could result in the wrong value of `self` being passed to a call
429
421
  - Don't add personality paths to the generated jungle file if the sdk is prior to 4.2.1
430
422
  - Fixes a bug in the source-to-source optimizer that could incorrectly infer that an `if` block was never entered when the if's comparison was between a primitive type, and a plain `Object`
@@ -435,7 +427,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
435
427
  ### 1.1.27
436
428
 
437
429
  - Bug fixes
438
-
439
430
  - Fixes an incorrect type check warning when an assignment to a local was incompatible with the type of a same-named non-local variable. This only affects the warning; it did not result in incorrect optimizations.
440
431
 
441
432
  - New features
@@ -444,13 +435,11 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
444
435
  ### 1.1.26
445
436
 
446
437
  - Bug fixes
447
-
448
438
  - fixes an issue in the post build optimizer which could cause pre variables to be inserted too late in a block that could throw (so that if the variable was used in, or after the catch block, it might not have been set).
449
439
  - fixes an issue with references in resource files, that could result in some references not being reported to the extension (only affects `Goto References` and `Goto Definition`)
450
440
  - fixes some issues converting the system function documentation to markdown (for the Hover, Completion and Signature providers in the extension).
451
441
 
452
442
  - New features
453
-
454
443
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.49](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1049) (including [#1.0.48](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1048) and [#1.0.47](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1047))
455
444
  - adds support for parsing (but not formatting) .mss files
456
445
  - Adds full support for personalities in `.jungle` and `.mss` files, including reading the per-device `personality.mss` files
@@ -468,7 +457,6 @@ All notable changes to the "monkeyc-optimizer" package will be documented in thi
468
457
  ### 1.1.24
469
458
 
470
459
  - Bug fixes
471
-
472
460
  - Conversion of unary `-x` to `0 - x` was too restrictive, causing some missed optimization opportunities
473
461
 
474
462
  - Post Build Optimizations
@@ -487,7 +475,6 @@ No functional change, just fixes a typo that broke the typescript exports.
487
475
  ### 1.1.22
488
476
 
489
477
  - Bug fixes
490
-
491
478
  - [Fixes a bug in Single Use Copy Prop](https://github.com/markw65/prettier-extension-monkeyc/issues/8)
492
479
 
493
480
  - Post Build Optimizations
@@ -500,11 +487,9 @@ No functional change, just fixes a typo that broke the typescript exports.
500
487
  ### 1.1.21
501
488
 
502
489
  - Bug fixes
503
-
504
490
  - fixed a bug that could cause dead-store elimination to delete stores that might be used if an exception was thrown. eg `try { x=1; foo(); x=2; } catch (ex) { System.println(x); x=3; }` could delete the first store to `x`, breaking the println if `foo` actually throws.
505
491
 
506
492
  - Source to Source Optimizations
507
-
508
493
  - convert `++` and `--` to `+= 1` and `-= 1`. Garmin's compiler generates exactly the same code for both, but when the `1` is written explicitly, its available for `sizeBasedPRE` to optimize.
509
494
  - convert `-x` to `0 - x`. Again, Garmin's compiler generates exactly the same code, but being explicit makes the `0` available to `sizeBasedPRE`.
510
495
  - rewrite some optimizations so that `-x` and `0-x` are treated identically. eg `(0-x) + y` => `y - x` (for suitably typed `x` and `y`).
@@ -518,7 +503,6 @@ No functional change, just fixes a typo that broke the typescript exports.
518
503
  ### 1.1.20
519
504
 
520
505
  - Bug fixes
521
-
522
506
  - Fix a bug that could cause the optimizer to incorrectly substitute one local for another.
523
507
 
524
508
  - Optimizations
@@ -527,7 +511,6 @@ No functional change, just fixes a typo that broke the typescript exports.
527
511
  ### 1.1.19
528
512
 
529
513
  - Bug fixes
530
-
531
514
  - Fix "Minimize Modules" in background/glance scopes
532
515
  - due to a [bug in the monkeyc compiler](https://forums.garmin.com/developer/connect-iq/i/bug-reports/import-rez-or-using-rez-breaks-background-resources), adding "using Rez;" when a resource may be loaded by a background or glance app causes it to crash. This release won't import Rez into anything marked :background or :glance. This fixes [prettier-extension-monkeyc#7](https://github.com/markw65/prettier-extension-monkeyc/issues/7)
533
516
  - Update background and glance offsets in the program header. I had assumed these offsets were obtained from the symbols, which already get updated, but it turns out they're stored as offsets in the header. This didn't break anything, but it did mean that the background and glance code sizes were unchanged, even though the post build optimizer had in fact made them smaller.
@@ -544,7 +527,6 @@ No functional change, just fixes a typo that broke the typescript exports.
544
527
  ### 1.1.17 (this package is missing two files)
545
528
 
546
529
  - Project infrastructure
547
-
548
530
  - Use worker threads to speed up exporting a .iq file. With an 8 core (16 with hyperthreading) system, my project goes from taking 28 seconds to generate the optimized source to less than 10. It still takes garmin's compiler nearly 3 minutes to compile though.
549
531
 
550
532
  - Bug fixes
@@ -553,7 +535,6 @@ No functional change, just fixes a typo that broke the typescript exports.
553
535
  ### 1.1.16
554
536
 
555
537
  - Project infrastructure
556
-
557
538
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.46](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1046)
558
539
  - no functional change.
559
540
  - switch from webpack to esbuild, for faster builds, and better packaging.
@@ -574,7 +555,6 @@ No functional change, just fixes a typo that broke the typescript exports.
574
555
  ### 1.1.15
575
556
 
576
557
  - Post build optimizer improvements
577
-
578
558
  - Simplify LogicalExpressions. This generally saves 3 bytes per `&&` or `||`, and also makes them faster
579
559
  - Adds a simple code sharing pass. If multiple code paths converge to the same point (or leave the function via return) and they end with the same sequence of bytecode, they're merged into one.
580
560
  - Flips branch-true to branch-false or vice versa if the fall through block has multiple predecessors, and the target block has just one. This often leads to better control flow, reducing the number of "goto" bytecodes required.
@@ -608,7 +588,6 @@ No functional change, just fixes a typo that broke the typescript exports.
608
588
  ### 1.1.11
609
589
 
610
590
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.44](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1044)
611
-
612
591
  - Fixes a parser bug relating to Methods returning Void, and a printer bug relating to nested Method declarations.
613
592
 
614
593
  - Bug fixes
@@ -636,7 +615,6 @@ No functional change, just fixes a typo that broke the typescript exports.
636
615
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.43](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1043)
637
616
 
638
617
  - Bug fixes
639
-
640
618
  - fix an interaction between inlining and removing unused local vars that could cause unlimited recursion leading to stack overflow
641
619
 
642
620
  - New optimizations
@@ -645,7 +623,6 @@ No functional change, just fixes a typo that broke the typescript exports.
645
623
  ### 1.1.8
646
624
 
647
625
  - Bug fixes
648
-
649
626
  - After making a non-modifying change to a variable, update the types of all equivalent variables. eg in `var x = y; if (y != null) { whatever }` we know that x is not null in `whatever`, even though we didn't explicitly test it.
650
627
  - Fix an issue with `import` and `using`. If an import happened after the definition of an inline function, inlined copies of the function might incorrectly use those imports resulting in finding the wrong symbols. This was rare - most imports happen at the top of the file, and generally an import will simply make something work that would have failed, rather than changing the behavior of something that already works. But I added a test case that exhibits the problem.
651
628
 
@@ -675,17 +652,14 @@ No functional change, just fixes a typo that broke the typescript exports.
675
652
  ### 1.1.4
676
653
 
677
654
  - Optimizations
678
-
679
655
  - Minor tweaks to dead store elimination
680
656
  - Better type resolution for untyped code
681
657
 
682
658
  - Enhancements
683
-
684
659
  - Retain the type map in the analysis pass, so that it can be used to improve
685
660
  the results in visitReferences
686
661
 
687
662
  - Bug fixes
688
-
689
663
  - When multiple diagnostics were reported for a single location, all but the last was lost
690
664
  - Sometimes when evaluating MemberExpressions type-flow would give up too easily, resulting
691
665
  in unknown types for the object, which then resulted in unexpected error messages from
@@ -699,14 +673,12 @@ No functional change, just fixes a typo that broke the typescript exports.
699
673
  ### 1.1.3
700
674
 
701
675
  - Tweaks and fixes
702
-
703
676
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.42](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1042)
704
677
  - Fixed an issue that cause inlining in return context to be too conservative
705
678
  - Update inliner to keep a stack of locations, so that error messages can show exactly where an error occurred, even in the presence of inlining.
706
679
  - Update diagnostic api to optionally include a uri to more detailing information.
707
680
 
708
681
  - Type Analysis
709
-
710
682
  - Track type info through branch conditions, so that in `if (x != null) { A } else { B }`, the type checker knows that x is not null in A, and it is null in B.
711
683
  - Added checkers for return types, call arguments, assignments and variable declarations.
712
684
  - Automatically infer Array and Dictionary types
@@ -737,11 +709,9 @@ No functional change, just fixes a typo that broke the typescript exports.
737
709
  ### 1.1.0
738
710
 
739
711
  - Implements a type analyzer, to enable better optimizations
740
-
741
712
  - adds options `trustDeclaredTypes` and `propagateTypes`. See https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis
742
713
 
743
714
  - Improved optimizations
744
-
745
715
  - SizeBasedPRE now has finer granularity, making it generally find more opportunities
746
716
  - Lots of improvements to binary operators, and folding. Subject to suitable type checks,
747
717
  - `(x + K1) + K2` => `x + (K1 + K2)`
@@ -765,11 +735,9 @@ No functional change, just fixes a typo that broke the typescript exports.
765
735
  ### 1.0.45
766
736
 
767
737
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.41](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1041)
768
-
769
738
  - Fixes a few parser edge cases
770
739
 
771
740
  - Bug fixes
772
-
773
741
  - Fix a bug constant folding == and !=
774
742
  - Make sure to include all languages, even for devices that don't support them, because they're still supported in settings. Do this in a way that avoids creating warnings.
775
743
  - Look at all build dependencies when deciding whether to regenerate the optimized files.
@@ -783,7 +751,6 @@ No functional change, just fixes a typo that broke the typescript exports.
783
751
  ### 1.0.44
784
752
 
785
753
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.40](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1040)
786
-
787
754
  - Fixes location ranges associated with parenthesized expressions
788
755
  - Fixes parsing of Lang.Char literals
789
756
 
@@ -793,7 +760,6 @@ No functional change, just fixes a typo that broke the typescript exports.
793
760
  ### 1.0.43
794
761
 
795
762
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.39](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1039)
796
-
797
763
  - Fixes issues parsing/printing/optimizing NaN
798
764
 
799
765
  - Fix issues with windows paths introduced in 1.0.42
@@ -804,12 +770,10 @@ No functional change, just fixes a typo that broke the typescript exports.
804
770
  ### 1.0.42
805
771
 
806
772
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.38](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1038)
807
-
808
773
  - faster parsing
809
774
  - supports parsing the attributes in api.mir, including sdk version etc.
810
775
 
811
776
  - Performance
812
-
813
777
  - Using the updated prettier-plugin-monkeyc halves the time spent in the parser
814
778
  - There was some pathological behavior in the jungle processing. For most projects, it was quite fast (under 1s), but the worst project I found took nearly 5 minutes. I fixed a lot of redundant processing, which dropped most projects to under 500ms, with a worst case of 20s.
815
779
  - I had some caching code to prevent reading the same resource file multiple times, but the cache didn't work properly because an async function ran in between the test of the cache, and the fill of the cache; which meant that lots of threads could test the cache and decide it needed to be filled. Fixed by caching Promises, rather than the promise results. Dropped the worst case 20s down to under 500ms, and the average down below 100ms.
@@ -826,7 +790,6 @@ No functional change, just fixes a typo that broke the typescript exports.
826
790
  ### 1.0.40
827
791
 
828
792
  - Improvements
829
-
830
793
  - Upgrade to [@markw65/prettier-plugin-monkeyc@1.0.37](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1037).
831
794
  - Report locations of errors in manifest.xml (rather than just reporting an error somewhere in the file)
832
795
  - Minor improvements to Goto References etc
@@ -837,7 +800,6 @@ No functional change, just fixes a typo that broke the typescript exports.
837
800
  - Fix lookups in static methods, under a new option that defaults to true.
838
801
 
839
802
  - Testing
840
-
841
803
  - Fix pragma checker to sort the diagnostics properly
842
804
  - Allow specifying which test to run on the command line
843
805
  - Update all tests to work with 4.1.6 and 4.1.7
@@ -849,7 +811,6 @@ No functional change, just fixes a typo that broke the typescript exports.
849
811
  ### 1.0.39
850
812
 
851
813
  - Improvements
852
-
853
814
  - Upgrade to [@markw65/prettier-plugin-monkeyc@1.0.36](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1036).
854
815
  - Upgrade all other npm dependencies to the latest versions, and fix a few issues that showed up as a result.
855
816
  - Report missing symbols after optimization, rather than before. Results in fewer false negatives. eg Given `if (foo has :bar) { return foo.bar; }`, where the compiler knows that foo.bar doesn't exist, the whole thing will be optimized away, rather than generate a diagnostic that foo.bar doesn't exist.
@@ -858,11 +819,9 @@ No functional change, just fixes a typo that broke the typescript exports.
858
819
  - Since we were already parsing all the resource files to look for `<build>` instructions, additionally identify all the symbols that will get generated. This allows us to detect references to undefined resources, and also makes `Goto Definition` just work for things like `Rez.Strings.foo`.
859
820
 
860
821
  - Optimizations
861
-
862
822
  - Optimize has expressions that are guaranteed to be false.
863
823
 
864
824
  - Bugs
865
-
866
825
  - Fix an issue with launchSimulator, which caused it to sometimes not bring the simulator window into focus when it should have done.
867
826
  - Fix an issue that caused simulateProgram to fail on windows.
868
827
  - Fix a bug looking up self when not part of a member-expression (this didn't happen until I added optimizations for "has" expressions, in this release)
@@ -897,7 +856,6 @@ No functional change, just fixes a typo that broke the typescript exports.
897
856
  ### 1.0.35
898
857
 
899
858
  - Testing
900
-
901
859
  - Add a new open source project
902
860
  - Fixup tests to work with compiler2beta2
903
861
 
@@ -907,7 +865,6 @@ No functional change, just fixes a typo that broke the typescript exports.
907
865
  ### 1.0.34
908
866
 
909
867
  - Bug fixes
910
-
911
868
  - Fix parser to allow white space to separate attributes, in addition to comma
912
869
  - Fix optimizer to respect prettier options when formatting the optimized code
913
870
 
@@ -918,7 +875,6 @@ No functional change, just fixes a typo that broke the typescript exports.
918
875
  ### 1.0.33
919
876
 
920
877
  - New features
921
-
922
878
  - Tagging a function with (:keep) will prevent the optimizer from removing it, even if it appears to be unused.
923
879
 
924
880
  - Bug fixes
@@ -933,7 +889,6 @@ No functional change, just fixes a typo that broke the typescript exports.
933
889
  ### 1.0.31
934
890
 
935
891
  - Bug fixes
936
-
937
892
  - Use withLocDeep on inline results
938
893
  - Better tracking of state.inType
939
894
  - Fix typo setting up the ProgramState
@@ -943,7 +898,6 @@ No functional change, just fixes a typo that broke the typescript exports.
943
898
  - I had forgotten to remove some code that I added to debug a problem
944
899
 
945
900
  - Code cleanup
946
-
947
901
  - Move all the global types to optimizer-types.ts, and explicitly import them
948
902
  - Be more consistent about when assignment/update lhs is traversed
949
903
  - Rework exposed flag
@@ -954,7 +908,6 @@ No functional change, just fixes a typo that broke the typescript exports.
954
908
  - Update for BigInt literals, and cleanup folding code
955
909
 
956
910
  - New features
957
-
958
911
  - Support `obj[:key]` as alternate for obj.key in lookup
959
912
  - `Find References`, and `Rename` will recognize these references now.
960
913
  - Add an unused variable cleanup pass
@@ -981,19 +934,15 @@ Bug Fixes
981
934
  ### 1.0.29
982
935
 
983
936
  - Update to `@markw65/prettier-plugin-monkeyc@1.0.32`
984
-
985
937
  - Fixes a parser issue where `x as Type ? a : b` would be parsed as `(x as Type?) a : b` which would then be reported as a syntax error.
986
938
 
987
939
  - Bug fixes
988
-
989
940
  - Fix a bug causing literal nodes to be shared. This was harmless prior to the implementation of the PRE pass
990
941
 
991
942
  - Code cleanup
992
-
993
943
  - Add `isStatement` and `isExpression` helpers
994
944
 
995
945
  - New features
996
-
997
946
  - Add constant folding for relational and logical operators
998
947
  - Allow assignment-scope inlining in variable initializers
999
948
  - Better cleanup of unused expressions
@@ -1036,7 +985,6 @@ Bug Fixes
1036
985
  ### 1.0.23
1037
986
 
1038
987
  - Bug Fixes
1039
-
1040
988
  - Don't treat parameters to Method types as undeclared variables
1041
989
  - eg `var x as (Method(a as Number, b as Number) as Void)` should not report that `a` and `b` are undeclared
1042
990
 
@@ -1047,9 +995,7 @@ Bug Fixes
1047
995
  ### 1.0.22
1048
996
 
1049
997
  - Improvements
1050
-
1051
998
  - Major rewrite of the symbol lookup mechanism, to match monkeyc as closely as possible
1052
-
1053
999
  - Fix callee lookup to skip local variables
1054
1000
  - Fix class lookup to first check all the super classes, then to check the context of each super class
1055
1001
  - Fix module lookup to check both the module, and the context of the module
@@ -1058,7 +1004,6 @@ Bug Fixes
1058
1004
  - Add live diagnostics for missing symbols
1059
1005
 
1060
1006
  - Bug fixes
1061
-
1062
1007
  - Recognize the the variable in a catch clause is a declaration
1063
1008
 
1064
1009
  - Breaking change
@@ -1067,7 +1012,6 @@ Bug Fixes
1067
1012
  ### 1.0.21
1068
1013
 
1069
1014
  - Bug fixes
1070
-
1071
1015
  - Parameters from the calling function should be treated just line locals when inlining
1072
1016
  - Upgrade to `@markw65/prettier-plugin-monkeyc@1.0.24`
1073
1017
  - fixes crash with comments following an attribute: `(:foo) /* comment */ function foo() {}`
@@ -1076,12 +1020,10 @@ Bug Fixes
1076
1020
  ### 1.0.20
1077
1021
 
1078
1022
  - Bug fixes
1079
-
1080
1023
  - Fix a bug marking unknown callees
1081
1024
  - Fix a bug in test.js that didn't notice when tests failed, and fix a failing test
1082
1025
 
1083
1026
  - Optimizer enhancements
1084
-
1085
1027
  - Re-run the main optimization step, to properly account for functions that are unused after optimization
1086
1028
  - Call the optimizer on 'unused' nodes before returning them
1087
1029
 
@@ -1091,18 +1033,15 @@ Bug Fixes
1091
1033
  ### 1.0.19
1092
1034
 
1093
1035
  - Upgrade to `@markw65/prettier-plugin-monkeyc@1.0.22`
1094
-
1095
1036
  - fixes some minor typing issues for mctree
1096
1037
  - special handling for certain parenthesized expressions.
1097
1038
 
1098
1039
  - Optimizer
1099
-
1100
1040
  - Handle more unused expressions, add tests, and prettify the OptimizerTests project
1101
1041
  - Allow statement-style inlining in assignment and return contexts
1102
1042
  - Add diagnostics for failure to inline
1103
1043
 
1104
1044
  - Tests
1105
-
1106
1045
  - More tweaks to pragma-checker
1107
1046
  - Add launch and task configs for building/running tests
1108
1047
 
@@ -1118,12 +1057,10 @@ Bug Fixes
1118
1057
  ### 1.0.17
1119
1058
 
1120
1059
  - New Features
1121
-
1122
1060
  - Extend the inliner to support more complex functions when called in a void context
1123
1061
  - Cleanup unused expressions. `0;x;foo.bar;a+b` will all now be optimized away.
1124
1062
 
1125
1063
  - Testing
1126
-
1127
1064
  - Rewrite the @match pragma implementation to have access to the next Node in the ast, rather than just the text of the remainder of the line.
1128
1065
  - Add tests for the statement inliner, and the unused expression cleanup code.
1129
1066
 
@@ -1133,13 +1070,11 @@ Bug Fixes
1133
1070
  ### 1.0.16
1134
1071
 
1135
1072
  - Bug fixes
1136
-
1137
1073
  - Fix off-by-one in removeNodeComments
1138
1074
  - Fix lookup to consistently lookup types or values.
1139
1075
  - Fix lookup of superclass names
1140
1076
 
1141
1077
  - New Features
1142
-
1143
1078
  - Add a simple inliner
1144
1079
  - Add support for conditional inlining based on excludeAnnotations
1145
1080
 
@@ -1156,7 +1091,6 @@ Bug Fixes
1156
1091
  ### 1.0.14
1157
1092
 
1158
1093
  - Bug fixes
1159
-
1160
1094
  - When reading a barrel project with no products, add all products by default
1161
1095
  - Only set language specific paths for languages that are supported by the device
1162
1096
  - Remove comments that are completely contained within removed nodes
@@ -1170,13 +1104,11 @@ Bug Fixes
1170
1104
  ### 1.0.13
1171
1105
 
1172
1106
  - Improvements
1173
-
1174
1107
  - Add displayName to deviceInfo (for getTargetDevices in prettier-extension-monkeyc)
1175
1108
  - Throw a better error when we fail to read a jungle file
1176
1109
  - Don't try to optimize barrel projects
1177
1110
 
1178
1111
  - Code cleanup
1179
-
1180
1112
  - Update to `@markw65/prettier-plugin-monkeyc@1.0.20` for mctree fixes
1181
1113
  - Enable typescript strict checks
1182
1114
  - Turn off synthetic default imports, and fix issues
@@ -1192,12 +1124,10 @@ Bug Fixes
1192
1124
  ### 1.0.11
1193
1125
 
1194
1126
  - Improvements
1195
-
1196
1127
  - Add option to run tests (for projects that have them)
1197
1128
  - Add getProjectAnalysis api, to support various language features in `@markw65/prettier-extension-monkeyc`
1198
1129
 
1199
1130
  - Bug fixes
1200
-
1201
1131
  - Fix lookup of self/me
1202
1132
 
1203
1133
  - Code cleanup
@@ -1229,7 +1159,6 @@ Bug Fixes
1229
1159
  ### 1.0.8
1230
1160
 
1231
1161
  - Improvements
1232
-
1233
1162
  - Update to `@markw65/prettier-plugin-monkeyc:1.0.14`
1234
1163
  - Parse and respect \<build\> instructions in resource files
1235
1164
  - Add minimal barrel support
@@ -1237,7 +1166,6 @@ Bug Fixes
1237
1166
  - Rename locals which would be marked re-declaring
1238
1167
 
1239
1168
  - Bug Fixes
1240
-
1241
1169
  - Generate the default jungle dynamically, since sdk/bin/default.jungle is generated lazily, and may not exist in newly installed sdks, or may be out of date after device installations.
1242
1170
  - Fix a bug generating language settings in optimized jungle
1243
1171
  - Fix a bug introduced by pick-one: don't modify a shared array
package/LICENSE.txt ADDED
@@ -0,0 +1,18 @@
1
+ Copyright 2025 Mark Williams
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/build/api.cjs CHANGED
@@ -18,52 +18,52 @@ 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_VAV4N2CL.checkCompilerVersion,
22
- clearDiagnostics: () => import_chunk_VAV4N2CL.clearDiagnostics,
23
- collectNamespaces: () => import_chunk_VAV4N2CL.collectNamespaces,
24
- createDocumentationMap: () => import_chunk_VAV4N2CL.createDocumentationMap,
25
- declKey: () => import_chunk_VAV4N2CL.declKey,
26
- diagnostic: () => import_chunk_VAV4N2CL.diagnostic,
27
- diagnosticHelper: () => import_chunk_VAV4N2CL.diagnosticHelper,
28
- findNamesInScope: () => import_chunk_VAV4N2CL.findNamesInScope,
29
- findUsingForNode: () => import_chunk_VAV4N2CL.findUsingForNode,
30
- formatAst: () => import_chunk_VAV4N2CL.formatAst,
31
- formatAstLongLines: () => import_chunk_VAV4N2CL.formatAstLongLines,
32
- formatScopedName: () => import_chunk_VAV4N2CL.formatScopedName,
33
- getApiFunctionInfo: () => import_chunk_VAV4N2CL.getApiFunctionInfo,
34
- getApiMapping: () => import_chunk_VAV4N2CL.getApiMapping,
35
- getSuperClasses: () => import_chunk_VAV4N2CL.getSuperClasses,
36
- handleImportUsing: () => import_chunk_VAV4N2CL.handleImportUsing,
21
+ checkCompilerVersion: () => import_chunk_BPXB3WQQ.checkCompilerVersion,
22
+ clearDiagnostics: () => import_chunk_BPXB3WQQ.clearDiagnostics,
23
+ collectNamespaces: () => import_chunk_BPXB3WQQ.collectNamespaces,
24
+ createDocumentationMap: () => import_chunk_BPXB3WQQ.createDocumentationMap,
25
+ declKey: () => import_chunk_BPXB3WQQ.declKey,
26
+ diagnostic: () => import_chunk_BPXB3WQQ.diagnostic,
27
+ diagnosticHelper: () => import_chunk_BPXB3WQQ.diagnosticHelper,
28
+ findNamesInScope: () => import_chunk_BPXB3WQQ.findNamesInScope,
29
+ findUsingForNode: () => import_chunk_BPXB3WQQ.findUsingForNode,
30
+ formatAst: () => import_chunk_BPXB3WQQ.formatAst,
31
+ formatAstLongLines: () => import_chunk_BPXB3WQQ.formatAstLongLines,
32
+ formatScopedName: () => import_chunk_BPXB3WQQ.formatScopedName,
33
+ getApiFunctionInfo: () => import_chunk_BPXB3WQQ.getApiFunctionInfo,
34
+ getApiMapping: () => import_chunk_BPXB3WQQ.getApiMapping,
35
+ getSuperClasses: () => import_chunk_BPXB3WQQ.getSuperClasses,
36
+ handleImportUsing: () => import_chunk_BPXB3WQQ.handleImportUsing,
37
37
  hasProperty: () => import_chunk_UBAYZSM3.hasProperty,
38
- isClassVariable: () => import_chunk_VAV4N2CL.isClassVariable,
39
- isLocal: () => import_chunk_VAV4N2CL.isLocal,
40
- isLookupCandidate: () => import_chunk_VAV4N2CL.isLookupCandidate,
41
- isStateNode: () => import_chunk_VAV4N2CL.isStateNode,
42
- lookupByFullName: () => import_chunk_VAV4N2CL.lookupByFullName,
43
- lookupNext: () => import_chunk_VAV4N2CL.lookupNext,
44
- lookupResultContains: () => import_chunk_VAV4N2CL.lookupResultContains,
45
- lookupWithType: () => import_chunk_VAV4N2CL.lookupWithType,
46
- makeToyboxLink: () => import_chunk_VAV4N2CL.makeToyboxLink,
47
- mapVarDeclsByType: () => import_chunk_VAV4N2CL.mapVarDeclsByType,
48
- markInvokeClassMethod: () => import_chunk_VAV4N2CL.markInvokeClassMethod,
49
- parseSdkVersion: () => import_chunk_VAV4N2CL.parseSdkVersion,
50
- popRootNode: () => import_chunk_VAV4N2CL.popRootNode,
51
- pushRootNode: () => import_chunk_VAV4N2CL.pushRootNode,
52
- resolveDiagnostics: () => import_chunk_VAV4N2CL.resolveDiagnostics,
53
- resolveDiagnosticsMap: () => import_chunk_VAV4N2CL.resolveDiagnosticsMap,
54
- sameLookupResult: () => import_chunk_VAV4N2CL.sameLookupResult,
38
+ isClassVariable: () => import_chunk_BPXB3WQQ.isClassVariable,
39
+ isLocal: () => import_chunk_BPXB3WQQ.isLocal,
40
+ isLookupCandidate: () => import_chunk_BPXB3WQQ.isLookupCandidate,
41
+ isStateNode: () => import_chunk_BPXB3WQQ.isStateNode,
42
+ lookupByFullName: () => import_chunk_BPXB3WQQ.lookupByFullName,
43
+ lookupNext: () => import_chunk_BPXB3WQQ.lookupNext,
44
+ lookupResultContains: () => import_chunk_BPXB3WQQ.lookupResultContains,
45
+ lookupWithType: () => import_chunk_BPXB3WQQ.lookupWithType,
46
+ makeToyboxLink: () => import_chunk_BPXB3WQQ.makeToyboxLink,
47
+ mapVarDeclsByType: () => import_chunk_BPXB3WQQ.mapVarDeclsByType,
48
+ markInvokeClassMethod: () => import_chunk_BPXB3WQQ.markInvokeClassMethod,
49
+ parseSdkVersion: () => import_chunk_BPXB3WQQ.parseSdkVersion,
50
+ popRootNode: () => import_chunk_BPXB3WQQ.popRootNode,
51
+ pushRootNode: () => import_chunk_BPXB3WQQ.pushRootNode,
52
+ resolveDiagnostics: () => import_chunk_BPXB3WQQ.resolveDiagnostics,
53
+ resolveDiagnosticsMap: () => import_chunk_BPXB3WQQ.resolveDiagnosticsMap,
54
+ sameLookupResult: () => import_chunk_BPXB3WQQ.sameLookupResult,
55
55
  traverseAst: () => import_chunk_UBAYZSM3.traverseAst,
56
- variableDeclarationName: () => import_chunk_VAV4N2CL.variableDeclarationName,
57
- visitReferences: () => import_chunk_VAV4N2CL.visitReferences,
58
- visit_resources: () => import_chunk_VAV4N2CL.visit_resources,
59
- visitorNode: () => import_chunk_VAV4N2CL.visitorNode
56
+ variableDeclarationName: () => import_chunk_BPXB3WQQ.variableDeclarationName,
57
+ visitReferences: () => import_chunk_BPXB3WQQ.visitReferences,
58
+ visit_resources: () => import_chunk_BPXB3WQQ.visit_resources,
59
+ visitorNode: () => import_chunk_BPXB3WQQ.visitorNode
60
60
  });
61
61
  module.exports = __toCommonJS(api_exports);
62
- var import_chunk_VAV4N2CL = require("./chunk-VAV4N2CL.cjs");
62
+ var import_chunk_BPXB3WQQ = require("./chunk-BPXB3WQQ.cjs");
63
63
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
64
64
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
65
65
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
66
- (0, import_chunk_VAV4N2CL.init_api)();
66
+ (0, import_chunk_BPXB3WQQ.init_api)();
67
67
  // Annotate the CommonJS export names for ESM import in node:
68
68
  0 && (module.exports = {
69
69
  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_VAV4N2CL_exports = {};
30
- __export(chunk_VAV4N2CL_exports, {
29
+ var chunk_BPXB3WQQ_exports = {};
30
+ __export(chunk_BPXB3WQQ_exports, {
31
31
  EnumTagsConst: () => EnumTagsConst,
32
32
  LastTypeTag: () => LastTypeTag,
33
33
  ObjectLikeTagsConst: () => ObjectLikeTagsConst,
@@ -140,7 +140,7 @@ __export(chunk_VAV4N2CL_exports, {
140
140
  visitorNode: () => visitorNode,
141
141
  xml_util_exports: () => xml_util_exports
142
142
  });
143
- module.exports = __toCommonJS(chunk_VAV4N2CL_exports);
143
+ module.exports = __toCommonJS(chunk_BPXB3WQQ_exports);
144
144
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
145
145
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
146
146
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
@@ -3392,9 +3392,8 @@ function skipClassDef(view, current, symbols, code) {
3392
3392
  const type = isVariableSized ? view.getUint8(current++) : f1 & 15;
3393
3393
  const addr = view.getUint32((current += 4) - 4);
3394
3394
  if (type !== 6) continue;
3395
- const section = addr >>> 28;
3396
- if (section === 1) {
3397
- const pc = addr & 16777215;
3395
+ if ((addr & SECTION_PC_MASK) === TEXT_SECTION_PC) {
3396
+ const pc = addr & PC_OFFSET_MASK;
3398
3397
  const method = symbols.methods.get(pc);
3399
3398
  if (method) {
3400
3399
  if (method.id != null) {
@@ -3447,9 +3446,8 @@ function fixupClassDef(view, current, offsetMap, code) {
3447
3446
  const type = isVariableSized ? view.getUint8(current++) : f1 & 15;
3448
3447
  const addr = view.getUint32((current += 4) - 4);
3449
3448
  if (type !== 6) continue;
3450
- const section = addr >>> 28;
3451
- if (section === 1) {
3452
- const pc = addr & 16777215;
3449
+ if ((addr & SECTION_PC_MASK) === TEXT_SECTION_PC) {
3450
+ const pc = addr & PC_OFFSET_MASK;
3453
3451
  const newPc = offsetMap.get(pc);
3454
3452
  (0, import_node_assert.default)(newPc != null);
3455
3453
  view.setUint32(current - 4, addr - pc + newPc);
@@ -15321,7 +15319,6 @@ function getFileASTs(fnMap) {
15321
15319
  try {
15322
15320
  value2.ast = import_prettier_plugin_monkeyc2.default.parsers.monkeyc.parse(
15323
15321
  value2.monkeyCSource,
15324
- null,
15325
15322
  options
15326
15323
  );
15327
15324
  } catch (e) {
@@ -16675,7 +16672,7 @@ function visit_resource_refs(state, doc, e, barrelNames) {
16675
16672
  }
16676
16673
  const startPos = (0, import_chunk_UBAYZSM3.adjustLoc)(loc, -1, 0).start;
16677
16674
  try {
16678
- const expr = import_prettier_plugin_monkeyc3.default.parsers.monkeyc.parse(`(${name})`, null, {
16675
+ const expr = import_prettier_plugin_monkeyc3.default.parsers.monkeyc.parse(`(${name})`, {
16679
16676
  filepath: loc.source || void 0,
16680
16677
  singleExpression: true
16681
16678
  });
@@ -16720,30 +16717,33 @@ function visit_resource_refs(state, doc, e, barrelNames) {
16720
16717
  }
16721
16718
  if (id === "personality") {
16722
16719
  const elems = dotted.match(/\s+|\S+/g);
16723
- elems?.reduce((loc, name) => {
16724
- if (/\s/.test(name)) {
16725
- const newLines = name.match(/\r\n|[\r\n]/g);
16726
- if (newLines?.length) {
16727
- loc.start.line += newLines.length;
16728
- loc.start.column = 1;
16729
- loc.start.offset += name.length;
16730
- name = name.replace(/^.*(\r\n|[\r\n])(.*)$/, "$2");
16731
- loc.start.offset -= name.length;
16720
+ elems?.reduce(
16721
+ (loc, name) => {
16722
+ if (/\s/.test(name)) {
16723
+ const newLines = name.match(/\r\n|[\r\n]/g);
16724
+ if (newLines?.length) {
16725
+ loc.start.line += newLines.length;
16726
+ loc.start.column = 1;
16727
+ loc.start.offset += name.length;
16728
+ name = name.replace(/^.*(\r\n|[\r\n])(.*)$/, "$2");
16729
+ loc.start.offset -= name.length;
16730
+ }
16731
+ } else {
16732
+ const colonPos = name.indexOf(":");
16733
+ const barrel = colonPos < 0 ? "" : name.slice(0, colonPos) + ".";
16734
+ name = name.slice(colonPos + 1);
16735
+ const base = (0, import_chunk_UBAYZSM3.makeScopedName)(`${barrel}Rez.Styles`);
16736
+ const idLoc = (0, import_chunk_UBAYZSM3.adjustLoc)(loc, colonPos + 1, 0);
16737
+ idLoc.end = { ...idLoc.start };
16738
+ idLoc.end.column += name.length;
16739
+ idLoc.end.offset += name.length;
16740
+ const id2 = (0, import_chunk_UBAYZSM3.makeIdentifier)(name, idLoc);
16741
+ result.push((0, import_chunk_UBAYZSM3.makeMemberExpression)((0, import_chunk_UBAYZSM3.withLoc)(base, id2, false), id2));
16732
16742
  }
16733
- } else {
16734
- const colonPos = name.indexOf(":");
16735
- const barrel = colonPos < 0 ? "" : name.slice(0, colonPos) + ".";
16736
- name = name.slice(colonPos + 1);
16737
- const base = (0, import_chunk_UBAYZSM3.makeScopedName)(`${barrel}Rez.Styles`);
16738
- const idLoc = (0, import_chunk_UBAYZSM3.adjustLoc)(loc, colonPos + 1, 0);
16739
- idLoc.end = { ...idLoc.start };
16740
- idLoc.end.column += name.length;
16741
- idLoc.end.offset += name.length;
16742
- const id2 = (0, import_chunk_UBAYZSM3.makeIdentifier)(name, idLoc);
16743
- result.push((0, import_chunk_UBAYZSM3.makeMemberExpression)((0, import_chunk_UBAYZSM3.withLoc)(base, id2, false), id2));
16744
- }
16745
- return (0, import_chunk_UBAYZSM3.adjustLoc)(loc, name.length, 0);
16746
- }, (0, import_chunk_UBAYZSM3.adjustLoc)(l, 0, 0));
16743
+ return (0, import_chunk_UBAYZSM3.adjustLoc)(loc, name.length, 0);
16744
+ },
16745
+ (0, import_chunk_UBAYZSM3.adjustLoc)(l, 0, 0)
16746
+ );
16747
16747
  return;
16748
16748
  }
16749
16749
  if (/^\s*(true|false|null|NaN|(0x|#)[0-9a-f]+|[-+]?\d+%?)\s*$/i.test(dotted)) {
@@ -17286,9 +17286,7 @@ function checkCompilerVersion(version, sdkVer) {
17286
17286
  }
17287
17287
  function pushRootNode(state, stack, root) {
17288
17288
  if (root.type === "Program") return;
17289
- const sn = root.stack?.at(-1)?.sn?.decls?.[root.name]?.find(
17290
- (sn2) => sn2.type === root.type && (root.nodes != null || sn2.node === root.node)
17291
- ) ?? state.nestedClasses[root.name]?.find((d) => d.node === root.node);
17289
+ const sn = root.stack?.at(-1)?.sn?.decls?.[root.name]?.find((sn2) => sn2.type === root.type && (root.nodes != null || sn2.node === root.node)) ?? state.nestedClasses[root.name]?.find((d) => d.node === root.node);
17292
17290
  if (!sn) {
17293
17291
  throw new Error(`Invalid stack for node ${root.fullName}`);
17294
17292
  }
@@ -17315,7 +17313,7 @@ async function getApiMapping(state, resourcesMap, manifestXML) {
17315
17313
  }
17316
17314
  }
17317
17315
  const api = (await fs2.readFile(`${sdk}bin/api.mir`)).toString().replace(/\r\n/g, "\n").replace(/^(\s*static)?\s*<init>\s*\{\s*\}\s*?\n/gm, "").replace(/^(\s*type)\s/gm, "$1def ");
17318
- const ast = parser.parse(api, null, {
17316
+ const ast = parser.parse(api, {
17319
17317
  filepath: "api.mir"
17320
17318
  });
17321
17319
  if (resourcesMap) {
@@ -19263,7 +19261,7 @@ function parseCode(view, lineTable) {
19263
19261
  const results = [];
19264
19262
  while (current < view.byteLength) {
19265
19263
  const nextOp = parseOne();
19266
- const lineNum = lineTable.get(nextOp.offset | 268435456);
19264
+ const lineNum = lineTable.get(nextOp.offset | TEXT_SECTION_PC);
19267
19265
  if (lineNum) {
19268
19266
  nextOp.lineNum = lineNum;
19269
19267
  }
@@ -19737,6 +19735,7 @@ var init_opcodes = (0, import_chunk_VS2QQHAK.__esm)({
19737
19735
  "src/readprg/opcodes.ts"() {
19738
19736
  "use strict";
19739
19737
  init_data_flow();
19738
+ init_bytecode();
19740
19739
  Opcodes = /* @__PURE__ */ ((Opcodes2) => {
19741
19740
  Opcodes2[Opcodes2["nop"] = 0] = "nop";
19742
19741
  Opcodes2[Opcodes2["incsp"] = 1] = "incsp";
@@ -22736,7 +22735,7 @@ function emitFunc(func, view, start, updateInfo, context) {
22736
22735
  if (bytecode.lineNum) {
22737
22736
  if (!lineNum || !compareLineInfo(lineNum, bytecode.lineNum)) {
22738
22737
  lineNum = { ...bytecode.lineNum };
22739
- lineNum.pc = offset | 268435456;
22738
+ lineNum.pc = offset | TEXT_SECTION_PC;
22740
22739
  updateInfo.lineMap.push(lineNum);
22741
22740
  }
22742
22741
  }
@@ -22946,6 +22945,7 @@ var init_emit = (0, import_chunk_VS2QQHAK.__esm)({
22946
22945
  "src/readprg/emit.ts"() {
22947
22946
  "use strict";
22948
22947
  (0, import_chunk_UBAYZSM3.init_ast)();
22948
+ init_bytecode();
22949
22949
  init_cflow();
22950
22950
  init_opcodes();
22951
22951
  init_optimize2();
@@ -23110,7 +23110,14 @@ function parseLineNum(view, debugXml) {
23110
23110
  return results;
23111
23111
  }
23112
23112
  function fixupLineNum(context, updateInfo) {
23113
- const symLineTable = updateInfo.lineMap.filter(
23113
+ const newLineTable = updateInfo.lineMap.concat(
23114
+ Array.from(context.lineTable.values()).filter(
23115
+ (lineNum) => (lineNum.pc & SECTION_PC_MASK) !== TEXT_SECTION_PC
23116
+ )
23117
+ );
23118
+ newLineTable.sort((a, b) => a.pc - b.pc);
23119
+ context.lineTable = new Map(newLineTable.map((l) => [l.pc, l]));
23120
+ const symLineTable = newLineTable.filter(
23114
23121
  (lineNum) => lineNum.file != null
23115
23122
  );
23116
23123
  const sectionLength = 2 + symLineTable.length * 16;
@@ -23142,7 +23149,7 @@ function fixupLineNum(context, updateInfo) {
23142
23149
  8,
23143
23150
  sectionLength
23144
23151
  );
23145
- const strLineTable = updateInfo.lineMap.filter(
23152
+ const strLineTable = newLineTable.filter(
23146
23153
  (lineNum) => lineNum.fileStr != null
23147
23154
  );
23148
23155
  if (context.debugXml.body instanceof Error) return;
@@ -23198,8 +23205,8 @@ function markLocals(context) {
23198
23205
  context.debugXml.body.children("localVars").children("entry").elements.forEach((entry) => {
23199
23206
  const { startPc, endPc, stackId, name, arg } = entry.attr;
23200
23207
  (0, import_node_assert16.default)(startPc && endPc && stackId && name);
23201
- const spc = Number(startPc.value.value) & 16777215;
23202
- const epc = (Number(endPc.value.value) & 16777215) + 1;
23208
+ const spc = Number(startPc.value.value) & PC_OFFSET_MASK;
23209
+ const epc = (Number(endPc.value.value) & PC_OFFSET_MASK) + 1;
23203
23210
  const sid = Number(stackId.value.value);
23204
23211
  let locals = localMap.get(spc);
23205
23212
  if (!locals) {
@@ -23332,7 +23339,7 @@ function optimizeBytecode(context) {
23332
23339
  funcArray.push({ offset: code.byteLength, blocks: /* @__PURE__ */ new Map() });
23333
23340
  const funcIndex = (pc) => {
23334
23341
  let lo = 0, hi = funcArray.length;
23335
- pc = pc & 16777215;
23342
+ pc = pc & PC_OFFSET_MASK;
23336
23343
  while (hi - lo > 1) {
23337
23344
  const mid = hi + lo >>> 1;
23338
23345
  if (funcArray[mid].offset > pc) {
@@ -23346,29 +23353,33 @@ function optimizeBytecode(context) {
23346
23353
  const funcRange = (pc) => {
23347
23354
  const index = funcIndex(pc);
23348
23355
  (0, import_node_assert16.default)(
23349
- funcArray[index].offset <= (pc & 16777215) && funcArray[index + 1].offset > (pc & 16777215)
23356
+ funcArray[index].offset <= (pc & PC_OFFSET_MASK) && funcArray[index + 1].offset > (pc & PC_OFFSET_MASK)
23350
23357
  );
23351
23358
  const s = offsetMap.get(funcArray[index].offset);
23352
23359
  const e = offsetMap.get(funcArray[index + 1].offset);
23353
23360
  if (s == null || e == null) {
23354
23361
  (0, import_node_assert16.default)(s != null && e != null);
23355
23362
  }
23356
- return [s + 268435456, e + 268435456];
23363
+ return [s + TEXT_SECTION_PC, e + TEXT_SECTION_PC];
23357
23364
  };
23358
23365
  const localVars = context.debugXml.body.children("localVars");
23359
23366
  const addAttr = (element, attrName, attrValue) => {
23360
23367
  element.attr[attrName] = xml_util_exports.makeAttribute(attrName, attrValue);
23361
23368
  };
23362
23369
  localVars.elements.forEach((element, i) => {
23370
+ const original = element.children;
23363
23371
  delete element.children;
23364
23372
  if (i) return;
23365
- element.children = [];
23366
- const children = element.children;
23373
+ const children = original?.filter((elt) => {
23374
+ if (elt.type !== "element") return false;
23375
+ if (!elt.attr?.startPc) return false;
23376
+ const spc = Number(elt.attr.startPc.value.value);
23377
+ return (spc & SECTION_PC_MASK) !== TEXT_SECTION_PC;
23378
+ }) ?? [];
23367
23379
  updateInfo.localRanges.forEach((localRange) => {
23368
23380
  if (localRange.endPc === localRange.startPc) {
23369
23381
  return;
23370
23382
  }
23371
- children.push({ type: "chardata", value: "\n" });
23372
23383
  const element2 = {
23373
23384
  type: "element",
23374
23385
  name: "entry",
@@ -23378,18 +23389,34 @@ function optimizeBytecode(context) {
23378
23389
  if (localRange.isParam) {
23379
23390
  addAttr(element2, "arg", "true");
23380
23391
  }
23381
- addAttr(element2, "startPc", (localRange.startPc + 268435456).toString());
23382
- addAttr(element2, "endPc", (localRange.endPc + 268435456).toString());
23392
+ addAttr(
23393
+ element2,
23394
+ "startPc",
23395
+ (localRange.startPc + TEXT_SECTION_PC).toString()
23396
+ );
23397
+ addAttr(
23398
+ element2,
23399
+ "endPc",
23400
+ (localRange.endPc + TEXT_SECTION_PC).toString()
23401
+ );
23383
23402
  addAttr(element2, "stackId", localRange.slot.toString());
23384
23403
  children.push(element2);
23385
23404
  });
23386
- children.push({ type: "chardata", value: "\n" });
23405
+ element.children = children.sort(
23406
+ (a, b) => Number(a.attr.startPc?.value.value ?? 0) - Number(b.attr.startPc?.value.value ?? 0)
23407
+ ).flatMap((e) => [{ type: "chardata", value: "\n" }, e]);
23408
+ element.children.push({ type: "chardata", value: "\n" });
23387
23409
  });
23388
23410
  context.debugXml.body.children("functions").children("functionEntry").elements.forEach((entry) => {
23389
23411
  const { startPc, endPc } = entry.attr;
23390
23412
  if (!startPc || !endPc) return;
23391
- const range = funcRange(Number(startPc.value.value));
23392
- (0, import_node_assert16.default)(funcRange(Number(endPc.value.value))[0] === range[0]);
23413
+ const spc = Number(startPc.value.value);
23414
+ const epc = Number(endPc.value.value);
23415
+ if ((spc & SECTION_PC_MASK) !== TEXT_SECTION_PC) {
23416
+ return;
23417
+ }
23418
+ const range = funcRange(spc);
23419
+ (0, import_node_assert16.default)(funcRange(epc)[0] === range[0]);
23393
23420
  startPc.value.value = range[0].toString();
23394
23421
  endPc.value.value = (range[1] - 1).toString();
23395
23422
  });
@@ -23823,7 +23850,7 @@ function countFallthroughPreds(func, block) {
23823
23850
  return count;
23824
23851
  }, 0);
23825
23852
  }
23826
- var SectionKinds;
23853
+ var SectionKinds, TEXT_SECTION_PC, SECTION_PC_MASK, PC_OFFSET_MASK;
23827
23854
  var init_bytecode = (0, import_chunk_VS2QQHAK.__esm)({
23828
23855
  "src/readprg/bytecode.ts"() {
23829
23856
  "use strict";
@@ -23841,6 +23868,7 @@ var init_bytecode = (0, import_chunk_VS2QQHAK.__esm)({
23841
23868
  SectionKinds2[SectionKinds2["HEADER"] = -805253120] = "HEADER";
23842
23869
  SectionKinds2[SectionKinds2["HEADER_VERSIONED"] = -805253107] = "HEADER_VERSIONED";
23843
23870
  SectionKinds2[SectionKinds2["TEXT"] = -1059145026] = "TEXT";
23871
+ SectionKinds2[SectionKinds2["EXTENDED"] = -1059188563] = "EXTENDED";
23844
23872
  SectionKinds2[SectionKinds2["DATA"] = -629491010] = "DATA";
23845
23873
  SectionKinds2[SectionKinds2["SYMBOLS"] = 1461170197] = "SYMBOLS";
23846
23874
  SectionKinds2[SectionKinds2["LINENUM"] = -1059161423] = "LINENUM";
@@ -23849,6 +23877,9 @@ var init_bytecode = (0, import_chunk_VS2QQHAK.__esm)({
23849
23877
  SectionKinds2[SectionKinds2["STORE_SIG"] = 20833] = "STORE_SIG";
23850
23878
  return SectionKinds2;
23851
23879
  })(SectionKinds || {});
23880
+ TEXT_SECTION_PC = 268435456;
23881
+ SECTION_PC_MASK = 4026531840;
23882
+ PC_OFFSET_MASK = 16777215;
23852
23883
  }
23853
23884
  });
23854
23885
  function getPrgSignature(context) {
@@ -23969,6 +24000,7 @@ var SymbolTable;
23969
24000
  var init_symbols = (0, import_chunk_VS2QQHAK.__esm)({
23970
24001
  "src/readprg/symbols.ts"() {
23971
24002
  "use strict";
24003
+ init_bytecode();
23972
24004
  SymbolTable = class {
23973
24005
  // given a symbol id, symbolToLabelMap.get(id) gives the
23974
24006
  // label offset, then symbols.get(label) gives us the symbol
@@ -23999,7 +24031,7 @@ var init_symbols = (0, import_chunk_VS2QQHAK.__esm)({
23999
24031
  const { startPc, name, parent } = functionEntry.attr;
24000
24032
  if (!startPc || !name) return;
24001
24033
  const fullPc = Number(startPc.value.value);
24002
- if (fullPc >>> 28 !== 1) {
24034
+ if ((fullPc & SECTION_PC_MASK) !== TEXT_SECTION_PC) {
24003
24035
  return;
24004
24036
  }
24005
24037
  const pc = fullPc & 16777215;
@@ -27355,7 +27387,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
27355
27387
  const opt_time = await (0, import_chunk_IJS7AYMN.first_modified)(
27356
27388
  Object.values(fnMap).map((v) => v.output)
27357
27389
  );
27358
- if (source_time < opt_time && 1767144581089 < opt_time) {
27390
+ if (source_time < opt_time && 1769531191295 < opt_time) {
27359
27391
  return {
27360
27392
  hasTests,
27361
27393
  diagnostics: prevDiagnostics,
@@ -27393,7 +27425,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
27393
27425
  hasTests: hasTests2,
27394
27426
  diagnostics,
27395
27427
  sdkVersion,
27396
- optimizerVersion: "1.1.92",
27428
+ optimizerVersion: "1.1.93",
27397
27429
  ...Object.fromEntries(
27398
27430
  configOptionsToCheck.map((option) => [option, config[option]])
27399
27431
  )
@@ -18,30 +18,30 @@ 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_VAV4N2CL.StateNodeAttributes,
22
- buildConfigDescription: () => import_chunk_VAV4N2CL.buildConfigDescription,
23
- buildOptimizedProject: () => import_chunk_VAV4N2CL.buildOptimizedProject,
21
+ StateNodeAttributes: () => import_chunk_BPXB3WQQ.StateNodeAttributes,
22
+ buildConfigDescription: () => import_chunk_BPXB3WQQ.buildConfigDescription,
23
+ buildOptimizedProject: () => import_chunk_BPXB3WQQ.buildOptimizedProject,
24
24
  copyRecursiveAsNeeded: () => import_chunk_IJS7AYMN.copyRecursiveAsNeeded,
25
- defaultConfig: () => import_chunk_VAV4N2CL.defaultConfig,
26
- display: () => import_chunk_VAV4N2CL.display,
27
- generateOneConfig: () => import_chunk_VAV4N2CL.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_VAV4N2CL.generateOptimizedProject,
29
- getConfig: () => import_chunk_VAV4N2CL.getConfig,
30
- getFnMapAnalysis: () => import_chunk_VAV4N2CL.getFnMapAnalysis,
31
- getProjectAnalysis: () => import_chunk_VAV4N2CL.getProjectAnalysis,
32
- get_jungle: () => import_chunk_VAV4N2CL.get_jungle,
33
- isErrorWithLocation: () => import_chunk_VAV4N2CL.isErrorWithLocation,
34
- launchSimulator: () => import_chunk_VAV4N2CL.launchSimulator,
35
- manifestProducts: () => import_chunk_VAV4N2CL.manifestProducts,
36
- mctree: () => import_chunk_VAV4N2CL.mctree,
37
- simulateProgram: () => import_chunk_VAV4N2CL.simulateProgram
25
+ defaultConfig: () => import_chunk_BPXB3WQQ.defaultConfig,
26
+ display: () => import_chunk_BPXB3WQQ.display,
27
+ generateOneConfig: () => import_chunk_BPXB3WQQ.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_BPXB3WQQ.generateOptimizedProject,
29
+ getConfig: () => import_chunk_BPXB3WQQ.getConfig,
30
+ getFnMapAnalysis: () => import_chunk_BPXB3WQQ.getFnMapAnalysis,
31
+ getProjectAnalysis: () => import_chunk_BPXB3WQQ.getProjectAnalysis,
32
+ get_jungle: () => import_chunk_BPXB3WQQ.get_jungle,
33
+ isErrorWithLocation: () => import_chunk_BPXB3WQQ.isErrorWithLocation,
34
+ launchSimulator: () => import_chunk_BPXB3WQQ.launchSimulator,
35
+ manifestProducts: () => import_chunk_BPXB3WQQ.manifestProducts,
36
+ mctree: () => import_chunk_BPXB3WQQ.mctree,
37
+ simulateProgram: () => import_chunk_BPXB3WQQ.simulateProgram
38
38
  });
39
39
  module.exports = __toCommonJS(optimizer_exports);
40
- var import_chunk_VAV4N2CL = require("./chunk-VAV4N2CL.cjs");
40
+ var import_chunk_BPXB3WQQ = require("./chunk-BPXB3WQQ.cjs");
41
41
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
42
42
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
43
43
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
44
- (0, import_chunk_VAV4N2CL.init_optimizer)();
44
+ (0, import_chunk_BPXB3WQQ.init_optimizer)();
45
45
  // Annotate the CommonJS export names for ESM import in node:
46
46
  0 && (module.exports = {
47
47
  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_VAV4N2CL.SectionKinds,
22
- appSupport: () => import_chunk_VAV4N2CL.appSupport,
23
- connectiq: () => import_chunk_VAV4N2CL.connectiq,
24
- getDeviceInfo: () => import_chunk_VAV4N2CL.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_VAV4N2CL.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_VAV4N2CL.getLanguages,
27
- getSdkPath: () => import_chunk_VAV4N2CL.getSdkPath,
28
- isWin: () => import_chunk_VAV4N2CL.isWin,
29
- optimizeProgram: () => import_chunk_VAV4N2CL.optimizeProgram,
30
- readPrg: () => import_chunk_VAV4N2CL.readPrg,
31
- readPrgWithOffsets: () => import_chunk_VAV4N2CL.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_VAV4N2CL.xml_util_exports
21
+ SectionKinds: () => import_chunk_BPXB3WQQ.SectionKinds,
22
+ appSupport: () => import_chunk_BPXB3WQQ.appSupport,
23
+ connectiq: () => import_chunk_BPXB3WQQ.connectiq,
24
+ getDeviceInfo: () => import_chunk_BPXB3WQQ.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_BPXB3WQQ.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_BPXB3WQQ.getLanguages,
27
+ getSdkPath: () => import_chunk_BPXB3WQQ.getSdkPath,
28
+ isWin: () => import_chunk_BPXB3WQQ.isWin,
29
+ optimizeProgram: () => import_chunk_BPXB3WQQ.optimizeProgram,
30
+ readPrg: () => import_chunk_BPXB3WQQ.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_BPXB3WQQ.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_BPXB3WQQ.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_VAV4N2CL = require("./chunk-VAV4N2CL.cjs");
35
+ var import_chunk_BPXB3WQQ = require("./chunk-BPXB3WQQ.cjs");
36
36
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
37
37
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
38
38
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
39
- (0, import_chunk_VAV4N2CL.init_sdk_util)();
39
+ (0, import_chunk_BPXB3WQQ.init_sdk_util)();
40
40
  // Annotate the CommonJS export names for ESM import in node:
41
41
  0 && (module.exports = {
42
42
  SectionKinds,
@@ -10,6 +10,7 @@ export declare const enum SectionKinds {
10
10
  HEADER = -805253120,
11
11
  HEADER_VERSIONED = -805253107,
12
12
  TEXT = -1059145026,
13
+ EXTENDED = -1059188563,
13
14
  DATA = -629491010,
14
15
  SYMBOLS = 1461170197,
15
16
  LINENUM = -1059161423,
@@ -17,6 +18,10 @@ export declare const enum SectionKinds {
17
18
  SIGNATURE = -507453934,
18
19
  STORE_SIG = 20833
19
20
  }
21
+ export declare const TEXT_SECTION_PC = 268435456;
22
+ export declare const EXTENDED_SECTION_BASE = 1342177280;
23
+ export declare const SECTION_PC_MASK = 4026531840;
24
+ export declare const PC_OFFSET_MASK = 16777215;
20
25
  export type SectionInfo = {
21
26
  offset: number;
22
27
  length: number;
@@ -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_VAV4N2CL = require("./chunk-VAV4N2CL.cjs");
24
+ var import_chunk_BPXB3WQQ = require("./chunk-BPXB3WQQ.cjs");
25
25
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
26
26
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
27
27
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
28
28
  var import_node_worker_threads = require("node:worker_threads");
29
29
  var require_worker_thread = (0, import_chunk_VS2QQHAK.__commonJS)({
30
30
  "src/worker-thread.ts"() {
31
- (0, import_chunk_VAV4N2CL.init_worker_task)();
31
+ (0, import_chunk_BPXB3WQQ.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_VAV4N2CL.performTask)(task));
34
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_BPXB3WQQ.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.92",
4
+ "version": "1.1.93",
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",
@@ -56,7 +56,7 @@
56
56
  "author": "markw65",
57
57
  "license": "MIT",
58
58
  "dependencies": {
59
- "@markw65/prettier-plugin-monkeyc": "^1.0.61",
59
+ "@markw65/prettier-plugin-monkeyc": "^1.0.64",
60
60
  "7z-wasm": "^1.2.0"
61
61
  },
62
62
  "devDependencies": {
@@ -64,7 +64,6 @@
64
64
  "@types/chai": "^4.3.4",
65
65
  "@types/glob": "^8.0.0",
66
66
  "@types/mocha": "^10.0.1",
67
- "@types/prettier": "^2.6.1",
68
67
  "@types/priorityqueuejs": "^1.0.1",
69
68
  "@typescript-eslint/eslint-plugin": "^5.28.0",
70
69
  "@typescript-eslint/parser": "^5.28.0",
@@ -74,11 +73,14 @@
74
73
  "fast-glob": "^3.2.12",
75
74
  "mocha": "^10.2.0",
76
75
  "peggy": "^3.0.2",
77
- "prettier": "^2.6.2",
76
+ "prettier": "^3.8.1",
78
77
  "prettier-plugin-pegjs": "^1.0.1",
79
78
  "priorityqueuejs": "^2.0.0",
80
79
  "typescript": "^5.0.4"
81
80
  },
81
+ "prettier": {
82
+ "trailingComma": "es5"
83
+ },
82
84
  "repository": {
83
85
  "type": "git",
84
86
  "url": "git+https://github.com/markw65/monkeyc-optimizer.git"