git.delta.rocks / jrsonnet / refs/commits / 75beb619a12f

difftreelog

ci use hercules

qvomslsuLach2026-04-01parent: #4824700.patch.diff
in: master

110 files changed

modified.envrcdiffbeforeafterboth
33
4use flake4use flake
55
6if ! diff .github/hooks/pre-commit .git/hooks/pre-commit >/dev/null; then6if ! test -d .jj && ! diff .github/hooks/pre-commit .git/hooks/pre-commit >/dev/null; then
7echo -e "${RED}Hooks are updated, read .github/hooks/pre-commit, and then install it with cp .github/hooks/pre-commit .git/hooks/pre-commit${RESET}"7echo -e "${RED}Hooks are updated, read .github/hooks/pre-commit, and then install it with cp .github/hooks/pre-commit .git/hooks/pre-commit${RESET}"
8fi8fi
99
deleted.github/workflows/checks.yamldiffbeforeafterboth

no changes

deleted.github/workflows/release.yamldiffbeforeafterboth

no changes

deleted.github/workflows/test.yamldiffbeforeafterboth

no changes

modifiedCargo.lockdiffbeforeafterboth
9checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"9checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
10dependencies = [10dependencies = [
11 "cfg-if",11 "cfg-if",
12 "getrandom",12 "getrandom 0.3.4",
13 "once_cell",13 "once_cell",
14 "version_check",14 "version_check",
15 "zerocopy",15 "zerocopy",
3838
39[[package]]39[[package]]
40name = "annotate-snippets"40name = "annotate-snippets"
41version = "0.12.11"41version = "0.12.13"
42source = "registry+https://github.com/rust-lang/crates.io-index"42source = "registry+https://github.com/rust-lang/crates.io-index"
43checksum = "16e4850548ff4a25a77ce3bda7241874e17fb702ea551f0cc62a2dbe052f1272"43checksum = "74fc7650eedcb2fee505aad48491529e408f0e854c2d9f63eb86c1361b9b3f93"
44dependencies = [44dependencies = [
45 "anstyle",45 "anstyle",
46 "memchr",
46 "unicode-width",47 "unicode-width",
47]48]
4849
5960
60[[package]]61[[package]]
61name = "anstream"62name = "anstream"
62version = "0.6.21"63version = "1.0.0"
63source = "registry+https://github.com/rust-lang/crates.io-index"64source = "registry+https://github.com/rust-lang/crates.io-index"
64checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"65checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
65dependencies = [66dependencies = [
66 "anstyle",67 "anstyle",
67 "anstyle-parse",68 "anstyle-parse",
7475
75[[package]]76[[package]]
76name = "anstyle"77name = "anstyle"
77version = "1.0.13"78version = "1.0.14"
78source = "registry+https://github.com/rust-lang/crates.io-index"79source = "registry+https://github.com/rust-lang/crates.io-index"
79checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"80checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
8081
81[[package]]82[[package]]
82name = "anstyle-parse"83name = "anstyle-parse"
83version = "0.2.7"84version = "1.0.0"
84source = "registry+https://github.com/rust-lang/crates.io-index"85source = "registry+https://github.com/rust-lang/crates.io-index"
85checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"86checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
86dependencies = [87dependencies = [
87 "utf8parse",88 "utf8parse",
88]89]
109110
110[[package]]111[[package]]
111name = "anyhow"112name = "anyhow"
112version = "1.0.101"113version = "1.0.102"
113source = "registry+https://github.com/rust-lang/crates.io-index"114source = "registry+https://github.com/rust-lang/crates.io-index"
114checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea"115checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
115116
116[[package]]117[[package]]
117name = "ar_archive_writer"118name = "ar_archive_writer"
142143
143[[package]]144[[package]]
144name = "bitflags"145name = "bitflags"
145version = "2.10.0"146version = "2.11.0"
146source = "registry+https://github.com/rust-lang/crates.io-index"147source = "registry+https://github.com/rust-lang/crates.io-index"
147checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"148checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
148149
149[[package]]150[[package]]
150name = "block-buffer"151name = "block-buffer"
167168
168[[package]]169[[package]]
169name = "bumpalo"170name = "bumpalo"
170version = "3.19.1"171version = "3.20.2"
171source = "registry+https://github.com/rust-lang/crates.io-index"172source = "registry+https://github.com/rust-lang/crates.io-index"
172checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"173checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
173dependencies = [174dependencies = [
174 "allocator-api2",175 "allocator-api2",
175]176]
176177
177[[package]]178[[package]]
178name = "cc"179name = "cc"
179version = "1.2.55"180version = "1.2.58"
180source = "registry+https://github.com/rust-lang/crates.io-index"181source = "registry+https://github.com/rust-lang/crates.io-index"
181checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"182checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1"
182dependencies = [183dependencies = [
183 "find-msvc-tools",184 "find-msvc-tools",
184 "shlex",185 "shlex",
192193
193[[package]]194[[package]]
194name = "clap"195name = "clap"
195version = "4.5.57"196version = "4.6.0"
196source = "registry+https://github.com/rust-lang/crates.io-index"197source = "registry+https://github.com/rust-lang/crates.io-index"
197checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a"198checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351"
198dependencies = [199dependencies = [
199 "clap_builder",200 "clap_builder",
200 "clap_derive",201 "clap_derive",
201]202]
202203
203[[package]]204[[package]]
204name = "clap_builder"205name = "clap_builder"
205version = "4.5.57"206version = "4.6.0"
206source = "registry+https://github.com/rust-lang/crates.io-index"207source = "registry+https://github.com/rust-lang/crates.io-index"
207checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238"208checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
208dependencies = [209dependencies = [
209 "anstream",210 "anstream",
210 "anstyle",211 "anstyle",
214215
215[[package]]216[[package]]
216name = "clap_complete"217name = "clap_complete"
217version = "4.5.65"218version = "4.6.0"
218source = "registry+https://github.com/rust-lang/crates.io-index"219source = "registry+https://github.com/rust-lang/crates.io-index"
219checksum = "430b4dc2b5e3861848de79627b2bedc9f3342c7da5173a14eaa5d0f8dc18ae5d"220checksum = "19c9f1dde76b736e3681f28cec9d5a61299cbaae0fce80a68e43724ad56031eb"
220dependencies = [221dependencies = [
221 "clap",222 "clap",
222]223]
223224
224[[package]]225[[package]]
225name = "clap_derive"226name = "clap_derive"
226version = "4.5.55"227version = "4.6.0"
227source = "registry+https://github.com/rust-lang/crates.io-index"228source = "registry+https://github.com/rust-lang/crates.io-index"
228checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"229checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a"
229dependencies = [230dependencies = [
230 "heck 0.5.0",231 "heck 0.5.0",
231 "proc-macro2",232 "proc-macro2",
235236
236[[package]]237[[package]]
237name = "clap_lex"238name = "clap_lex"
238version = "0.7.7"239version = "1.1.0"
239source = "registry+https://github.com/rust-lang/crates.io-index"240source = "registry+https://github.com/rust-lang/crates.io-index"
240checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"241checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
241242
242[[package]]243[[package]]
243name = "colorchoice"244name = "colorchoice"
244version = "1.0.4"245version = "1.0.5"
245source = "registry+https://github.com/rust-lang/crates.io-index"246source = "registry+https://github.com/rust-lang/crates.io-index"
246checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"247checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
247248
248[[package]]249[[package]]
249name = "console"250name = "console"
250version = "0.15.11"251version = "0.16.3"
251source = "registry+https://github.com/rust-lang/crates.io-index"252source = "registry+https://github.com/rust-lang/crates.io-index"
252checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8"253checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87"
253dependencies = [254dependencies = [
254 "encode_unicode",255 "encode_unicode",
255 "libc",256 "libc",
256 "once_cell",
257 "windows-sys 0.59.0",257 "windows-sys 0.61.2",
258]258]
259259
260[[package]]260[[package]]
302 "bumpalo",302 "bumpalo",
303 "hashbrown 0.15.5",303 "hashbrown 0.15.5",
304 "indexmap",304 "indexmap",
305 "rustc-hash 2.1.1",305 "rustc-hash 2.1.2",
306 "serde",306 "serde",
307 "unicode-width",307 "unicode-width",
308]308]
451 "cfg-if",451 "cfg-if",
452 "js-sys",452 "js-sys",
453 "libc",453 "libc",
454 "r-efi",454 "r-efi 5.3.0",
455 "wasip2",455 "wasip2",
456 "wasm-bindgen",456 "wasm-bindgen",
457]457]
458
459[[package]]
460name = "getrandom"
461version = "0.4.2"
462source = "registry+https://github.com/rust-lang/crates.io-index"
463checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
464dependencies = [
465 "cfg-if",
466 "libc",
467 "r-efi 6.0.0",
468 "wasip2",
469 "wasip3",
470]
458471
459[[package]]472[[package]]
460name = "globset"473name = "globset"
537 "str_indices",550 "str_indices",
538]551]
552
553[[package]]
554name = "id-arena"
555version = "2.3.0"
556source = "registry+https://github.com/rust-lang/crates.io-index"
557checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
539558
540[[package]]559[[package]]
541name = "indexmap"560name = "indexmap"
560579
561[[package]]580[[package]]
562name = "insta"581name = "insta"
563version = "1.46.3"582version = "1.47.2"
564source = "registry+https://github.com/rust-lang/crates.io-index"583source = "registry+https://github.com/rust-lang/crates.io-index"
565checksum = "e82db8c87c7f1ccecb34ce0c24399b8a73081427f3c7c50a5d597925356115e4"584checksum = "7b4a6248eb93a4401ed2f37dfe8ea592d3cf05b7cf4f8efa867b6895af7e094e"
566dependencies = [585dependencies = [
567 "console",586 "console",
568 "globset",587 "globset",
589608
590[[package]]609[[package]]
591name = "itoa"610name = "itoa"
592version = "1.0.17"611version = "1.0.18"
593source = "registry+https://github.com/rust-lang/crates.io-index"612source = "registry+https://github.com/rust-lang/crates.io-index"
594checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"613checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
595614
596[[package]]615[[package]]
597name = "jrsonnet"616name = "jrsonnet"
598version = "0.5.0-pre97"617version = "0.5.0-pre98"
599dependencies = [618dependencies = [
600 "clap",619 "clap",
601 "clap_complete",620 "clap_complete",
612631
613[[package]]632[[package]]
614name = "jrsonnet-cli"633name = "jrsonnet-cli"
615version = "0.5.0-pre97"634version = "0.5.0-pre98"
616dependencies = [635dependencies = [
617 "clap",636 "clap",
618 "jrsonnet-evaluator",637 "jrsonnet-evaluator",
623642
624[[package]]643[[package]]
625name = "jrsonnet-deps"644name = "jrsonnet-deps"
626version = "0.5.0-pre97"645version = "0.5.0-pre98"
627dependencies = [646dependencies = [
628 "clap",647 "clap",
629 "jrsonnet-cli",648 "jrsonnet-cli",
634653
635[[package]]654[[package]]
636name = "jrsonnet-evaluator"655name = "jrsonnet-evaluator"
637version = "0.5.0-pre97"656version = "0.5.0-pre98"
638dependencies = [657dependencies = [
639 "annotate-snippets",658 "annotate-snippets",
640 "anyhow",659 "anyhow",
649 "jrsonnet-types",668 "jrsonnet-types",
650 "num-bigint",669 "num-bigint",
651 "pathdiff",670 "pathdiff",
652 "rustc-hash 2.1.1",671 "rustc-hash 2.1.2",
653 "rustversion",672 "rustversion",
654 "serde",673 "serde",
655 "stacker",674 "stacker",
660679
661[[package]]680[[package]]
662name = "jrsonnet-fmt"681name = "jrsonnet-fmt"
663version = "0.5.0-pre97"682version = "0.5.0-pre98"
664dependencies = [683dependencies = [
665 "clap",684 "clap",
666 "hi-doc",685 "hi-doc",
672691
673[[package]]692[[package]]
674name = "jrsonnet-formatter"693name = "jrsonnet-formatter"
675version = "0.5.0-pre97"694version = "0.5.0-pre98"
676dependencies = [695dependencies = [
677 "dprint-core",696 "dprint-core",
678 "hi-doc",697 "hi-doc",
704723
705[[package]]724[[package]]
706name = "jrsonnet-interner"725name = "jrsonnet-interner"
707version = "0.5.0-pre97"726version = "0.5.0-pre98"
708dependencies = [727dependencies = [
709 "hashbrown 0.16.1",728 "hashbrown 0.16.1",
710 "jrsonnet-gcmodule",729 "jrsonnet-gcmodule",
711 "rustc-hash 2.1.1",730 "rustc-hash 2.1.2",
712]731]
713732
714[[package]]733[[package]]
715name = "jrsonnet-ir"734name = "jrsonnet-ir"
716version = "0.5.0-pre97"735version = "0.5.0-pre98"
717dependencies = [736dependencies = [
718 "insta",737 "insta",
719 "jrsonnet-gcmodule",738 "jrsonnet-gcmodule",
724743
725[[package]]744[[package]]
726name = "jrsonnet-ir-parser"745name = "jrsonnet-ir-parser"
727version = "0.5.0-pre97"746version = "0.5.0-pre98"
728dependencies = [747dependencies = [
729 "insta",748 "insta",
730 "jrsonnet-gcmodule",749 "jrsonnet-gcmodule",
734753
735[[package]]754[[package]]
736name = "jrsonnet-lexer"755name = "jrsonnet-lexer"
737version = "0.5.0-pre97"756version = "0.5.0-pre98"
738dependencies = [757dependencies = [
739 "logos",758 "logos",
740]759]
741760
742[[package]]761[[package]]
743name = "jrsonnet-macros"762name = "jrsonnet-macros"
744version = "0.5.0-pre97"763version = "0.5.0-pre98"
745dependencies = [764dependencies = [
746 "proc-macro2",765 "proc-macro2",
747 "quote",766 "quote",
751770
752[[package]]771[[package]]
753name = "jrsonnet-peg-parser"772name = "jrsonnet-peg-parser"
754version = "0.5.0-pre97"773version = "0.5.0-pre98"
755dependencies = [774dependencies = [
756 "insta",775 "insta",
757 "jrsonnet-gcmodule",776 "jrsonnet-gcmodule",
761780
762[[package]]781[[package]]
763name = "jrsonnet-rowan-parser"782name = "jrsonnet-rowan-parser"
764version = "0.5.0-pre97"783version = "0.5.0-pre98"
765dependencies = [784dependencies = [
766 "anyhow",785 "anyhow",
767 "drop_bomb",786 "drop_bomb",
776795
777[[package]]796[[package]]
778name = "jrsonnet-stdlib"797name = "jrsonnet-stdlib"
779version = "0.5.0-pre97"798version = "0.5.0-pre98"
780dependencies = [799dependencies = [
781 "base64",800 "base64",
782 "jrsonnet-evaluator",801 "jrsonnet-evaluator",
787 "md5",806 "md5",
788 "num-bigint",807 "num-bigint",
789 "regex",808 "regex",
790 "rustc-hash 2.1.1",809 "rustc-hash 2.1.2",
791 "serde",810 "serde",
792 "serde-saphyr",811 "serde-saphyr",
793 "serde_json",812 "serde_json",
798817
799[[package]]818[[package]]
800name = "jrsonnet-types"819name = "jrsonnet-types"
801version = "0.5.0-pre97"820version = "0.5.0-pre98"
802dependencies = [821dependencies = [
803 "jrsonnet-gcmodule",822 "jrsonnet-gcmodule",
804 "peg",823 "peg",
805]824]
806825
807[[package]]826[[package]]
808name = "js-sys"827name = "js-sys"
809version = "0.3.85"828version = "0.3.94"
810source = "registry+https://github.com/rust-lang/crates.io-index"829source = "registry+https://github.com/rust-lang/crates.io-index"
811checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"830checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
812dependencies = [831dependencies = [
813 "once_cell",832 "once_cell",
814 "wasm-bindgen",833 "wasm-bindgen",
815]834]
816835
817[[package]]836[[package]]
818name = "keccak"837name = "keccak"
819version = "0.1.5"838version = "0.1.6"
820source = "registry+https://github.com/rust-lang/crates.io-index"839source = "registry+https://github.com/rust-lang/crates.io-index"
821checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"840checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653"
822dependencies = [841dependencies = [
823 "cpufeatures",842 "cpufeatures",
824]843]
844
845[[package]]
846name = "leb128fmt"
847version = "0.1.0"
848source = "registry+https://github.com/rust-lang/crates.io-index"
849checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
825850
826[[package]]851[[package]]
827name = "libc"852name = "libc"
828version = "0.2.180"853version = "0.2.184"
829source = "registry+https://github.com/rust-lang/crates.io-index"854source = "registry+https://github.com/rust-lang/crates.io-index"
830checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"855checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
831856
832[[package]]857[[package]]
833name = "libjsonnet"858name = "libjsonnet"
834version = "0.5.0-pre97"859version = "0.5.0-pre98"
835dependencies = [860dependencies = [
836 "jrsonnet-evaluator",861 "jrsonnet-evaluator",
837 "jrsonnet-gcmodule",862 "jrsonnet-gcmodule",
842867
843[[package]]868[[package]]
844name = "linux-raw-sys"869name = "linux-raw-sys"
845version = "0.11.0"870version = "0.12.1"
846source = "registry+https://github.com/rust-lang/crates.io-index"871source = "registry+https://github.com/rust-lang/crates.io-index"
847checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"872checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
848873
849[[package]]874[[package]]
850name = "log"875name = "log"
970995
971[[package]]996[[package]]
972name = "once_cell"997name = "once_cell"
973version = "1.21.3"998version = "1.21.4"
974source = "registry+https://github.com/rust-lang/crates.io-index"999source = "registry+https://github.com/rust-lang/crates.io-index"
975checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"1000checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
9761001
977[[package]]1002[[package]]
978name = "once_cell_polyfill"1003name = "once_cell_polyfill"
1046 "zerocopy",1071 "zerocopy",
1047]1072]
1073
1074[[package]]
1075name = "prettyplease"
1076version = "0.2.37"
1077source = "registry+https://github.com/rust-lang/crates.io-index"
1078checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
1079dependencies = [
1080 "proc-macro2",
1081 "syn",
1082]
10481083
1049[[package]]1084[[package]]
1050name = "proc-macro2"1085name = "proc-macro2"
10801115
1081[[package]]1116[[package]]
1082name = "quote"1117name = "quote"
1083version = "1.0.44"1118version = "1.0.45"
1084source = "registry+https://github.com/rust-lang/crates.io-index"1119source = "registry+https://github.com/rust-lang/crates.io-index"
1085checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"1120checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
1086dependencies = [1121dependencies = [
1087 "proc-macro2",1122 "proc-macro2",
1088]1123]
1093source = "registry+https://github.com/rust-lang/crates.io-index"1128source = "registry+https://github.com/rust-lang/crates.io-index"
1094checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"1129checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
1130
1131[[package]]
1132name = "r-efi"
1133version = "6.0.0"
1134source = "registry+https://github.com/rust-lang/crates.io-index"
1135checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
10951136
1096[[package]]1137[[package]]
1097name = "rand"1138name = "rand"
1119source = "registry+https://github.com/rust-lang/crates.io-index"1160source = "registry+https://github.com/rust-lang/crates.io-index"
1120checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"1161checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
1121dependencies = [1162dependencies = [
1122 "getrandom",1163 "getrandom 0.3.4",
1123]1164]
11241165
1125[[package]]1166[[package]]
11651206
1166[[package]]1207[[package]]
1167name = "regex-syntax"1208name = "regex-syntax"
1168version = "0.8.9"1209version = "0.8.10"
1169source = "registry+https://github.com/rust-lang/crates.io-index"1210source = "registry+https://github.com/rust-lang/crates.io-index"
1170checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"1211checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
11711212
1172[[package]]1213[[package]]
1173name = "rowan"1214name = "rowan"
11891230
1190[[package]]1231[[package]]
1191name = "rustc-hash"1232name = "rustc-hash"
1192version = "2.1.1"1233version = "2.1.2"
1193source = "registry+https://github.com/rust-lang/crates.io-index"1234source = "registry+https://github.com/rust-lang/crates.io-index"
1194checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"1235checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
11951236
1196[[package]]1237[[package]]
1197name = "rustix"1238name = "rustix"
1198version = "1.1.3"1239version = "1.1.4"
1199source = "registry+https://github.com/rust-lang/crates.io-index"1240source = "registry+https://github.com/rust-lang/crates.io-index"
1200checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"1241checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
1201dependencies = [1242dependencies = [
1202 "bitflags",1243 "bitflags",
1203 "errno",1244 "errno",
1232 "thiserror",1273 "thiserror",
1233]1274]
1275
1276[[package]]
1277name = "semver"
1278version = "1.0.27"
1279source = "registry+https://github.com/rust-lang/crates.io-index"
1280checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
12341281
1235[[package]]1282[[package]]
1236name = "serde"1283name = "serde"
1252 "annotate-snippets",1299 "annotate-snippets",
1253 "base64",1300 "base64",
1254 "encoding_rs_io",1301 "encoding_rs_io",
1255 "getrandom",1302 "getrandom 0.3.4",
1256 "nohash-hasher",1303 "nohash-hasher",
1257 "num-traits",1304 "num-traits",
1258 "regex",1305 "regex",
14011448
1402[[package]]1449[[package]]
1403name = "syn"1450name = "syn"
1404version = "2.0.114"1451version = "2.0.117"
1405source = "registry+https://github.com/rust-lang/crates.io-index"1452source = "registry+https://github.com/rust-lang/crates.io-index"
1406checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"1453checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
1407dependencies = [1454dependencies = [
1408 "proc-macro2",1455 "proc-macro2",
1409 "quote",1456 "quote",
14231470
1424[[package]]1471[[package]]
1425name = "tempfile"1472name = "tempfile"
1426version = "3.24.0"1473version = "3.27.0"
1427source = "registry+https://github.com/rust-lang/crates.io-index"1474source = "registry+https://github.com/rust-lang/crates.io-index"
1428checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"1475checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
1429dependencies = [1476dependencies = [
1430 "fastrand",1477 "fastrand",
1431 "getrandom",1478 "getrandom 0.4.2",
1432 "once_cell",1479 "once_cell",
1433 "rustix",1480 "rustix",
1434 "windows-sys 0.61.2",1481 "windows-sys 0.61.2",
14741521
1475[[package]]1522[[package]]
1476name = "tree-sitter"1523name = "tree-sitter"
1477version = "0.26.5"1524version = "0.26.8"
1478source = "registry+https://github.com/rust-lang/crates.io-index"1525source = "registry+https://github.com/rust-lang/crates.io-index"
1479checksum = "12987371f54efc9b9306a20dc87ed5aaee9f320c8a8b115e28515c412b2efe39"1526checksum = "887bd495d0582c5e3e0d8ece2233666169fa56a9644d172fc22ad179ab2d0538"
1480dependencies = [1527dependencies = [
1481 "cc",1528 "cc",
1482 "regex",1529 "regex",
14881535
1489[[package]]1536[[package]]
1490name = "tree-sitter-highlight"1537name = "tree-sitter-highlight"
1491version = "0.26.5"1538version = "0.26.8"
1492source = "registry+https://github.com/rust-lang/crates.io-index"1539source = "registry+https://github.com/rust-lang/crates.io-index"
1493checksum = "2b688407049ea1b55a7e872f138947d22389118b9c4d09b459cb34ca205e41c0"1540checksum = "ccde2b54a34b58313e69c02496a2a9ad38d59af79b196b5e1df063431752a7e0"
1494dependencies = [1541dependencies = [
1495 "regex",1542 "regex",
1496 "streaming-iterator",1543 "streaming-iterator",
15241571
1525[[package]]1572[[package]]
1526name = "unicode-ident"1573name = "unicode-ident"
1527version = "1.0.22"1574version = "1.0.24"
1528source = "registry+https://github.com/rust-lang/crates.io-index"1575source = "registry+https://github.com/rust-lang/crates.io-index"
1529checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"1576checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
15301577
1531[[package]]1578[[package]]
1532name = "unicode-width"1579name = "unicode-width"
1533version = "0.2.2"1580version = "0.2.2"
1534source = "registry+https://github.com/rust-lang/crates.io-index"1581source = "registry+https://github.com/rust-lang/crates.io-index"
1535checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"1582checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
1583
1584[[package]]
1585name = "unicode-xid"
1586version = "0.2.6"
1587source = "registry+https://github.com/rust-lang/crates.io-index"
1588checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
15361589
1537[[package]]1590[[package]]
1538name = "utf8parse"1591name = "utf8parse"
1574 "wit-bindgen",1627 "wit-bindgen",
1575]1628]
1629
1630[[package]]
1631name = "wasip3"
1632version = "0.4.0+wasi-0.3.0-rc-2026-01-06"
1633source = "registry+https://github.com/rust-lang/crates.io-index"
1634checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5"
1635dependencies = [
1636 "wit-bindgen",
1637]
15761638
1577[[package]]1639[[package]]
1578name = "wasm-bindgen"1640name = "wasm-bindgen"
1579version = "0.2.108"1641version = "0.2.117"
1580source = "registry+https://github.com/rust-lang/crates.io-index"1642source = "registry+https://github.com/rust-lang/crates.io-index"
1581checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"1643checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
1582dependencies = [1644dependencies = [
1583 "cfg-if",1645 "cfg-if",
1584 "once_cell",1646 "once_cell",
15891651
1590[[package]]1652[[package]]
1591name = "wasm-bindgen-macro"1653name = "wasm-bindgen-macro"
1592version = "0.2.108"1654version = "0.2.117"
1593source = "registry+https://github.com/rust-lang/crates.io-index"1655source = "registry+https://github.com/rust-lang/crates.io-index"
1594checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"1656checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
1595dependencies = [1657dependencies = [
1596 "quote",1658 "quote",
1597 "wasm-bindgen-macro-support",1659 "wasm-bindgen-macro-support",
1598]1660]
15991661
1600[[package]]1662[[package]]
1601name = "wasm-bindgen-macro-support"1663name = "wasm-bindgen-macro-support"
1602version = "0.2.108"1664version = "0.2.117"
1603source = "registry+https://github.com/rust-lang/crates.io-index"1665source = "registry+https://github.com/rust-lang/crates.io-index"
1604checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"1666checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
1605dependencies = [1667dependencies = [
1606 "bumpalo",1668 "bumpalo",
1607 "proc-macro2",1669 "proc-macro2",
16121674
1613[[package]]1675[[package]]
1614name = "wasm-bindgen-shared"1676name = "wasm-bindgen-shared"
1615version = "0.2.108"1677version = "0.2.117"
1616source = "registry+https://github.com/rust-lang/crates.io-index"1678source = "registry+https://github.com/rust-lang/crates.io-index"
1617checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"1679checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
1618dependencies = [1680dependencies = [
1619 "unicode-ident",1681 "unicode-ident",
1620]1682]
1683
1684[[package]]
1685name = "wasm-encoder"
1686version = "0.244.0"
1687source = "registry+https://github.com/rust-lang/crates.io-index"
1688checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319"
1689dependencies = [
1690 "leb128fmt",
1691 "wasmparser",
1692]
1693
1694[[package]]
1695name = "wasm-metadata"
1696version = "0.244.0"
1697source = "registry+https://github.com/rust-lang/crates.io-index"
1698checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
1699dependencies = [
1700 "anyhow",
1701 "indexmap",
1702 "wasm-encoder",
1703 "wasmparser",
1704]
1705
1706[[package]]
1707name = "wasmparser"
1708version = "0.244.0"
1709source = "registry+https://github.com/rust-lang/crates.io-index"
1710checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
1711dependencies = [
1712 "bitflags",
1713 "hashbrown 0.15.5",
1714 "indexmap",
1715 "semver",
1716]
16211717
1622[[package]]1718[[package]]
1623name = "winapi-util"1719name = "winapi-util"
1721version = "0.51.0"1817version = "0.51.0"
1722source = "registry+https://github.com/rust-lang/crates.io-index"1818source = "registry+https://github.com/rust-lang/crates.io-index"
1723checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"1819checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
1820dependencies = [
1821 "wit-bindgen-rust-macro",
1822]
1823
1824[[package]]
1825name = "wit-bindgen-core"
1826version = "0.51.0"
1827source = "registry+https://github.com/rust-lang/crates.io-index"
1828checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
1829dependencies = [
1830 "anyhow",
1831 "heck 0.5.0",
1832 "wit-parser",
1833]
1834
1835[[package]]
1836name = "wit-bindgen-rust"
1837version = "0.51.0"
1838source = "registry+https://github.com/rust-lang/crates.io-index"
1839checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
1840dependencies = [
1841 "anyhow",
1842 "heck 0.5.0",
1843 "indexmap",
1844 "prettyplease",
1845 "syn",
1846 "wasm-metadata",
1847 "wit-bindgen-core",
1848 "wit-component",
1849]
1850
1851[[package]]
1852name = "wit-bindgen-rust-macro"
1853version = "0.51.0"
1854source = "registry+https://github.com/rust-lang/crates.io-index"
1855checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a"
1856dependencies = [
1857 "anyhow",
1858 "prettyplease",
1859 "proc-macro2",
1860 "quote",
1861 "syn",
1862 "wit-bindgen-core",
1863 "wit-bindgen-rust",
1864]
1865
1866[[package]]
1867name = "wit-component"
1868version = "0.244.0"
1869source = "registry+https://github.com/rust-lang/crates.io-index"
1870checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
1871dependencies = [
1872 "anyhow",
1873 "bitflags",
1874 "indexmap",
1875 "log",
1876 "serde",
1877 "serde_derive",
1878 "serde_json",
1879 "wasm-encoder",
1880 "wasm-metadata",
1881 "wasmparser",
1882 "wit-parser",
1883]
1884
1885[[package]]
1886name = "wit-parser"
1887version = "0.244.0"
1888source = "registry+https://github.com/rust-lang/crates.io-index"
1889checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
1890dependencies = [
1891 "anyhow",
1892 "id-arena",
1893 "indexmap",
1894 "log",
1895 "semver",
1896 "serde",
1897 "serde_derive",
1898 "serde_json",
1899 "unicode-xid",
1900 "wasmparser",
1901]
17241902
1725[[package]]1903[[package]]
1726name = "xshell"1904name = "xshell"
17591937
1760[[package]]1938[[package]]
1761name = "zerocopy"1939name = "zerocopy"
1762version = "0.8.39"1940version = "0.8.48"
1763source = "registry+https://github.com/rust-lang/crates.io-index"1941source = "registry+https://github.com/rust-lang/crates.io-index"
1764checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a"1942checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
1765dependencies = [1943dependencies = [
1766 "zerocopy-derive",1944 "zerocopy-derive",
1767]1945]
17681946
1769[[package]]1947[[package]]
1770name = "zerocopy-derive"1948name = "zerocopy-derive"
1771version = "0.8.39"1949version = "0.8.48"
1772source = "registry+https://github.com/rust-lang/crates.io-index"1950source = "registry+https://github.com/rust-lang/crates.io-index"
1773checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517"1951checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
1774dependencies = [1952dependencies = [
1775 "proc-macro2",1953 "proc-macro2",
1776 "quote",1954 "quote",
17791957
1780[[package]]1958[[package]]
1781name = "zmij"1959name = "zmij"
1782version = "1.0.19"1960version = "1.0.21"
1783source = "registry+https://github.com/rust-lang/crates.io-index"1961source = "registry+https://github.com/rust-lang/crates.io-index"
1784checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"1962checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
17851963
modifiedCargo.tomldiffbeforeafterboth
8edition = "2021"8edition = "2021"
9license = "MIT"9license = "MIT"
10repository = "https://github.com/CertainLach/jrsonnet"10repository = "https://github.com/CertainLach/jrsonnet"
11version = "0.5.0-pre97"11version = "0.5.0-pre98"
1212
13[workspace.dependencies]13[workspace.dependencies]
14jrsonnet-evaluator = { path = "./crates/jrsonnet-evaluator", version = "0.5.0-pre97" }14jrsonnet-evaluator = { path = "./crates/jrsonnet-evaluator", version = "0.5.0-pre98" }
15jrsonnet-macros = { path = "./crates/jrsonnet-macros", version = "0.5.0-pre97" }15jrsonnet-macros = { path = "./crates/jrsonnet-macros", version = "0.5.0-pre98" }
16jrsonnet-ir = { path = "./crates/jrsonnet-ir", version = "0.5.0-pre97" }16jrsonnet-ir = { path = "./crates/jrsonnet-ir", version = "0.5.0-pre98" }
17jrsonnet-ir-parser = { path = "./crates/jrsonnet-ir-parser", version = "0.5.0-pre97" }17jrsonnet-ir-parser = { path = "./crates/jrsonnet-ir-parser", version = "0.5.0-pre98" }
18jrsonnet-peg-parser = { path = "./crates/jrsonnet-peg-parser", version = "0.5.0-pre97" }18jrsonnet-peg-parser = { path = "./crates/jrsonnet-peg-parser", version = "0.5.0-pre98" }
19jrsonnet-rowan-parser = { path = "./crates/jrsonnet-rowan-parser", version = "0.5.0-pre97" }19jrsonnet-rowan-parser = { path = "./crates/jrsonnet-rowan-parser", version = "0.5.0-pre98" }
20jrsonnet-interner = { path = "./crates/jrsonnet-interner", version = "0.5.0-pre97" }20jrsonnet-interner = { path = "./crates/jrsonnet-interner", version = "0.5.0-pre98" }
21jrsonnet-stdlib = { path = "./crates/jrsonnet-stdlib", version = "0.5.0-pre97" }21jrsonnet-stdlib = { path = "./crates/jrsonnet-stdlib", version = "0.5.0-pre98" }
22jrsonnet-cli = { path = "./crates/jrsonnet-cli", version = "0.5.0-pre97" }22jrsonnet-cli = { path = "./crates/jrsonnet-cli", version = "0.5.0-pre98" }
23jrsonnet-types = { path = "./crates/jrsonnet-types", version = "0.5.0-pre97" }23jrsonnet-types = { path = "./crates/jrsonnet-types", version = "0.5.0-pre98" }
24jrsonnet-formatter = { path = "./crates/jrsonnet-formatter", version = "0.5.0-pre97" }24jrsonnet-formatter = { path = "./crates/jrsonnet-formatter", version = "0.5.0-pre98" }
25jrsonnet-gcmodule = { version = "0.4.2" }25jrsonnet-gcmodule = { version = "0.4.2" }
26# Diagnostics.26# Diagnostics.
27# hi-doc is my library, which handles text formatting very well, but isn't polished enough yet27# hi-doc is my library, which handles text formatting very well, but isn't polished enough yet
modifiedbindings/jsonnet/Cargo.tomldiffbeforeafterboth
41experimental = ["exp-preserve-order", "exp-destruct"]41experimental = ["exp-preserve-order", "exp-destruct"]
42exp-preserve-order = ["jrsonnet-evaluator/exp-preserve-order", "jrsonnet-stdlib/exp-preserve-order"]42exp-preserve-order = [
43 "jrsonnet-evaluator/exp-preserve-order",
44 "jrsonnet-stdlib/exp-preserve-order",
45]
43exp-destruct = ["jrsonnet-evaluator/exp-destruct"]46exp-destruct = ["jrsonnet-evaluator/exp-destruct"]
4447
modifiedbindings/jsonnet/src/import.rsdiffbeforeafterboth
5 cell::RefCell,5 cell::RefCell,
6 collections::HashMap,6 collections::HashMap,
7 env::current_dir,7 env::current_dir,
8 ffi::{c_void, CStr, CString},8 ffi::{CStr, CString, c_void},
9 os::raw::{c_char, c_int},9 os::raw::{c_char, c_int},
10 path::PathBuf,10 path::PathBuf,
11 ptr::null_mut,11 ptr::null_mut,
12};12};
1313
14use jrsonnet_evaluator::{14use jrsonnet_evaluator::{
15 bail,15 AsPathLike, ImportResolver, ResolvePath, bail,
16 error::{ErrorKind::*, Result},16 error::{ErrorKind::*, Result},
17 AsPathLike, ImportResolver, ResolvePath,
18};17};
19use jrsonnet_gcmodule::Acyclic;18use jrsonnet_gcmodule::Acyclic;
20use jrsonnet_ir::{SourceDirectory, SourceFile, SourcePath};19use jrsonnet_ir::{SourceDirectory, SourceFile, SourcePath};
modifiedbindings/jsonnet/src/lib.rsdiffbeforeafterboth
21};21};
2222
23use jrsonnet_evaluator::{23use jrsonnet_evaluator::{
24 apply_tla, bail,24 AsPathLike, FileImportResolver, IStr, ImportResolver, Result, State, Val, apply_tla, bail,
25 gc::WithCapacityExt as _,25 gc::WithCapacityExt as _,
26 manifest::{JsonFormat, ManifestFormat, ToStringFormat},26 manifest::{JsonFormat, ManifestFormat, ToStringFormat},
27 rustc_hash::FxHashMap,27 rustc_hash::FxHashMap,
28 stack::set_stack_depth_limit,28 stack::set_stack_depth_limit,
29 tla::TlaArg,29 tla::TlaArg,
30 trace::{CompactFormat, PathResolver, TraceFormat},30 trace::{CompactFormat, PathResolver, TraceFormat},
31 AsPathLike, FileImportResolver, IStr, ImportResolver, Result, State, Val,
32};31};
33use jrsonnet_gcmodule::Acyclic;32use jrsonnet_gcmodule::Acyclic;
34use jrsonnet_ir::SourcePath;33use jrsonnet_ir::SourcePath;
modifiedbindings/jsonnet/src/native.rsdiffbeforeafterboth
1use std::{1use std::{
2 ffi::{c_void, CStr},2 ffi::{CStr, c_void},
3 os::raw::{c_char, c_int},3 os::raw::{c_char, c_int},
4};4};
55
6use jrsonnet_evaluator::{6use jrsonnet_evaluator::{
7 IStr, Val,
7 error::{Error, ErrorKind},8 error::{Error, ErrorKind},
8 function::builtin::{NativeCallback, NativeCallbackHandler},9 function::builtin::{NativeCallback, NativeCallbackHandler},
9 typed::FromUntyped as _,10 typed::FromUntyped as _,
10 IStr, Val,
11};11};
1212
13use crate::VM;13use crate::VM;
modifiedbindings/jsonnet/src/val_make.rsdiffbeforeafterboth
6};6};
77
8use jrsonnet_evaluator::{8use jrsonnet_evaluator::{
9 ObjValue, Val,
9 val::{ArrValue, NumValue},10 val::{ArrValue, NumValue},
10 ObjValue, Val,
11};11};
1212
13use crate::VM;13use crate::VM;
modifiedbindings/jsonnet/src/val_modify.rsdiffbeforeafterboth
44
5use std::{ffi::CStr, os::raw::c_char};5use std::{ffi::CStr, os::raw::c_char};
66
7use jrsonnet_evaluator::{val::ArrValue, Thunk, Val};7use jrsonnet_evaluator::{Thunk, Val, val::ArrValue};
88
9use crate::VM;9use crate::VM;
1010
modifiedbindings/jsonnet/src/vars_tlas.rsdiffbeforeafterboth
22
3use std::{ffi::CStr, os::raw::c_char};3use std::{ffi::CStr, os::raw::c_char};
44
5use jrsonnet_evaluator::tla::TlaArg;5use jrsonnet_evaluator::{IStr, tla::TlaArg};
6use jrsonnet_evaluator::IStr;
76
8use crate::VM;7use crate::VM;
98
modifiedcmds/jrsonnet-deps/src/main.rsdiffbeforeafterboth
1use std::collections::BTreeSet;1use std::{collections::BTreeSet, process::exit};
2
2use std::process::exit;3use clap::Parser;
3
4use clap::Parser;4use jrsonnet_cli::MiscOpts;
5use jrsonnet_evaluator::{FileImportResolver, ImportResolver};5use jrsonnet_evaluator::{FileImportResolver, ImportResolver};
6use jrsonnet_ir::{visit::Visitor, IStr, Source, SourcePath};6use jrsonnet_ir::{IStr, Source, SourcePath, visit::Visitor};
7use jrsonnet_ir_parser::ParserSettings;7use jrsonnet_ir_parser::ParserSettings;
8
9use jrsonnet_cli::MiscOpts;
108
11#[derive(Parser)]9#[derive(Parser)]
12struct Opts {10struct Opts {
modifiedcmds/jrsonnet-fmt/src/main.rsdiffbeforeafterboth
6};6};
77
8use clap::Parser;8use clap::Parser;
9use jrsonnet_formatter::{format, FormatOptions};9use jrsonnet_formatter::{FormatOptions, format};
1010
11#[derive(Parser)]11#[derive(Parser)]
12#[allow(clippy::struct_excessive_bools)]12#[allow(clippy::struct_excessive_bools)]
modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth

no syntactic changes

modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
1use std::{1use std::{
2 fs::{create_dir_all, File},2 fs::{File, create_dir_all},
3 io::{Read, Write},3 io::{Read, Write},
4};4};
55
6use clap::{CommandFactory, Parser};6use clap::{CommandFactory, Parser};
7use clap_complete::Shell;7use clap_complete::Shell;
8use jrsonnet_cli::{GcOpts, ManifestOpts, MiscOpts, OutputOpts, StdOpts, TlaOpts, TraceOpts};8use jrsonnet_cli::{GcOpts, ManifestOpts, MiscOpts, OutputOpts, StdOpts, TlaOpts, TraceOpts};
9use jrsonnet_evaluator::{9use jrsonnet_evaluator::{
10 apply_tla, bail,10 ResultExt, State, Val, apply_tla, bail,
11 error::{Error as JrError, ErrorKind},11 error::{Error as JrError, ErrorKind},
12 ResultExt, State, Val,
13};12};
14use jrsonnet_ir::{SourceDefaultIgnoreJpath, SourcePath};13use jrsonnet_ir::{SourceDefaultIgnoreJpath, SourcePath};
1514
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
17]17]
18exp-bigint = [18exp-bigint = ["jrsonnet-evaluator/exp-bigint", "jrsonnet-stdlib/exp-bigint"]
19 "jrsonnet-evaluator/exp-bigint",
20 "jrsonnet-stdlib/exp-bigint",
21]
22exp-null-coaelse = [19exp-null-coaelse = [
23 "jrsonnet-evaluator/exp-null-coaelse",20 "jrsonnet-evaluator/exp-null-coaelse",
24 "jrsonnet-stdlib/exp-null-coaelse",21 "jrsonnet-stdlib/exp-null-coaelse",
25]22]
26exp-regex = [23exp-regex = ["jrsonnet-stdlib/exp-regex"]
27 "jrsonnet-stdlib/exp-regex",
28]
2924
30[dependencies]25[dependencies]
modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
77
8use clap::Parser;8use clap::Parser;
9use jrsonnet_evaluator::{9use jrsonnet_evaluator::{
10 FileImportResolver,
10 stack::{limit_stack_depth, StackDepthLimitOverrideGuard},11 stack::{StackDepthLimitOverrideGuard, limit_stack_depth},
11 FileImportResolver,
12};12};
13use jrsonnet_gcmodule::{with_thread_object_space, ObjectSpace};13use jrsonnet_gcmodule::{ObjectSpace, with_thread_object_space};
14pub use manifest::*;14pub use manifest::*;
15pub use stdlib::*;15pub use stdlib::*;
16pub use tla::*;16pub use tla::*;
modifiedcrates/jrsonnet-cli/src/stdlib.rsdiffbeforeafterboth
1use std::str::FromStr;1use std::str::FromStr;
22
3use clap::Parser;3use clap::Parser;
4use jrsonnet_evaluator::tla::TlaArg;
5use jrsonnet_evaluator::{trace::PathResolver, Result};4use jrsonnet_evaluator::{Result, tla::TlaArg, trace::PathResolver};
6use jrsonnet_stdlib::ContextInitializer;5use jrsonnet_stdlib::ContextInitializer;
76
8#[derive(Clone)]7#[derive(Clone)]
modifiedcrates/jrsonnet-cli/src/tla.rsdiffbeforeafterboth
1use clap::Parser;1use clap::Parser;
2use jrsonnet_evaluator::tla::TlaArg;
3use jrsonnet_evaluator::{error::Result, gc::WithCapacityExt as _, rustc_hash::FxHashMap, IStr};2use jrsonnet_evaluator::{
3 IStr, error::Result, gc::WithCapacityExt as _, rustc_hash::FxHashMap, tla::TlaArg,
4};
45
5use crate::{ExtFile, ExtStr};6use crate::{ExtFile, ExtStr};
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
28# Implements field destructuring28# Implements field destructuring
29exp-destruct = ["jrsonnet-peg-parser?/exp-destruct", "jrsonnet-ir-parser?/exp-destruct"]29exp-destruct = [
30 "jrsonnet-peg-parser?/exp-destruct",
31 "jrsonnet-ir-parser?/exp-destruct",
32]
30# Iteration over objects yields [key, value] elements33# Iteration over objects yields [key, value] elements
31exp-object-iteration = []34exp-object-iteration = []
32# Bigint type35# Bigint type
33exp-bigint = ["num-bigint", "jrsonnet-types/exp-bigint"]36exp-bigint = ["num-bigint", "jrsonnet-types/exp-bigint"]
34# obj?.field, obj?.['field']37# obj?.field, obj?.['field']
35exp-null-coaelse = ["jrsonnet-peg-parser?/exp-null-coaelse", "jrsonnet-ir-parser?/exp-null-coaelse"]38exp-null-coaelse = [
39 "jrsonnet-peg-parser?/exp-null-coaelse",
40 "jrsonnet-ir-parser?/exp-null-coaelse",
41]
3642
37[dependencies]43[dependencies]
74 "Debug",
75 "Eq",
76 "Hash",
77 "PartialEq",
78] }
6779
68[build-dependencies]80[build-dependencies]
modifiedcrates/jrsonnet-evaluator/src/arr/mod.rsdiffbeforeafterboth
5 rc::Rc,5 rc::Rc,
6};6};
77
8use jrsonnet_gcmodule::{cc_dyn, Cc};8use jrsonnet_gcmodule::{Cc, cc_dyn};
9use jrsonnet_interner::IBytes;9use jrsonnet_interner::IBytes;
10use jrsonnet_ir::Expr;10use jrsonnet_ir::Expr;
1111
12use crate::{function::NativeFn, typed::IntoUntyped, Context, Result, Thunk, Val};12use crate::{Context, Result, Thunk, Val, function::NativeFn, typed::IntoUntyped};
1313
14mod spec;14mod spec;
15pub use spec::{ArrayLike, *};15pub use spec::{ArrayLike, *};
modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
1use std::rc::Rc;
2use std::{any::Any, cell::RefCell, fmt::Debug, mem::replace};1use std::{any::Any, cell::RefCell, fmt::Debug, mem::replace, rc::Rc};
32
4use jrsonnet_gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
5use jrsonnet_interner::{IBytes, IStr};4use jrsonnet_interner::{IBytes, IStr};
6use jrsonnet_ir::Expr;5use jrsonnet_ir::Expr;
76
8use super::ArrValue;7use super::ArrValue;
9use crate::function::NativeFn;
10use crate::{8use crate::{
9 Context, Error, ObjValue, Result, Thunk, Val,
11 error::ErrorKind::InfiniteRecursionDetected,10 error::ErrorKind::InfiniteRecursionDetected,
12 evaluate,11 evaluate,
12 function::NativeFn,
13 typed::{IntoUntyped, Typed},13 typed::{IntoUntyped, Typed},
14 val::ThunkValue,14 val::ThunkValue,
15 Context, Error, ObjValue, Result, Thunk, Val,
16};15};
1716
18pub trait ArrayLike: Any + Trace + Debug {17pub trait ArrayLike: Any + Trace + Debug {
modifiedcrates/jrsonnet-evaluator/src/async_import.rsdiffbeforeafterboth
1use std::rc::Rc;
2use std::{any::Any, cell::RefCell, future::Future};1use std::{any::Any, cell::RefCell, future::Future, rc::Rc};
32
4use jrsonnet_gcmodule::Acyclic;3use jrsonnet_gcmodule::Acyclic;
5use jrsonnet_ir::visit::Visitor;
6use jrsonnet_ir::{IStr, Source, SourcePath};4use jrsonnet_ir::{IStr, Source, SourcePath, visit::Visitor};
7use rustc_hash::FxHashMap;5use rustc_hash::FxHashMap;
86
9use crate::{AsPathLike, FileData, ImportResolver, ResolvePathOwned, State};7use crate::{AsPathLike, FileData, ImportResolver, ResolvePathOwned, State};
modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
6use rustc_hash::FxHashMap;6use rustc_hash::FxHashMap;
77
8use crate::{8use crate::{
9 error::ErrorKind::*, gc::WithCapacityExt as _, map::LayeredHashMap, ObjValue, Pending, Result,9 ObjValue, Pending, Result, SupThis, Thunk, Val, error::ErrorKind::*, gc::WithCapacityExt as _,
10 SupThis, Thunk, Val,10 map::LayeredHashMap,
11};11};
12/// Context keeps information about current lexical code location12/// Context keeps information about current lexical code location
13///13///
modifiedcrates/jrsonnet-evaluator/src/dynamic.rsdiffbeforeafterboth
3use educe::Educe;3use educe::Educe;
4use jrsonnet_gcmodule::{Cc, Trace};4use jrsonnet_gcmodule::{Cc, Trace};
55
6use crate::{bail, error::ErrorKind::InfiniteRecursionDetected, val::ThunkValue, Result};6use crate::{Result, bail, error::ErrorKind::InfiniteRecursionDetected, val::ThunkValue};
77
8#[derive(Trace, Educe)]8#[derive(Trace, Educe)]
9#[educe(Clone)]9#[educe(Clone)]
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
7use thiserror::Error;7use thiserror::Error;
88
9use crate::{9use crate::{
10 ObjValue, ResolvePathOwned,
10 function::{CallLocation, FunctionSignature, ParamName},11 function::{CallLocation, FunctionSignature, ParamName},
11 stdlib::format::FormatError,12 stdlib::format::FormatError,
12 typed::TypeLocError,13 typed::TypeLocError,
13 val::ConvertNumValueError,14 val::ConvertNumValueError,
14 ObjValue, ResolvePathOwned,
15};15};
1616
17#[derive(Debug, Clone)]17#[derive(Debug, Clone)]
271}274}
272impl fmt::Display for Error {275impl fmt::Display for Error {
273 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {276 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
274 writeln!(f, "{}", self.0 .0)?;277 writeln!(f, "{}", self.0.0)?;
275 for el in &self.0 .1 .0 {278 for el in &self.0.1.0 {
276 write!(f, "\t{}", el.desc)?;279 write!(f, "\t{}", el.desc)?;
277 if let Some(loc) = &el.location {280 if let Some(loc) = &el.location {
278 write!(f, "at {}", loc.0 .0 .0)?;281 write!(f, "at {}", loc.0.0.0)?;
279 loc.0.map_source_locations(&[loc.1, loc.2]);282 loc.0.map_source_locations(&[loc.1, loc.2]);
280 }283 }
281 writeln!(f)?;284 writeln!(f)?;
modifiedcrates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth
3use jrsonnet_interner::IStr;3use jrsonnet_interner::IStr;
4use jrsonnet_ir::{BindSpec, Destruct};4use jrsonnet_ir::{BindSpec, Destruct};
5
6use crate::{
7 bail,
8 error::{ErrorKind::*, Result},
9 evaluate_method, evaluate_named_param, Context, Pending, Thunk, Val,
10};
115
12#[cfg(feature = "exp-preserve-order")]6#[cfg(feature = "exp-preserve-order")]
13use crate::evaluate;7use crate::evaluate;
8use crate::{
9 Context, Pending, Thunk, Val, bail,
10 error::{ErrorKind::*, Result},
11 evaluate_method, evaluate_named_param,
12};
1413
15#[allow(clippy::too_many_lines)]14#[allow(clippy::too_many_lines)]
16#[allow(unused_variables)]15#[allow(unused_variables)]
107 }106 }
108 #[cfg(feature = "exp-destruct")]107 #[cfg(feature = "exp-destruct")]
109 Destruct::Object { fields, rest } => {108 Destruct::Object { fields, rest } => {
110 use crate::ObjValueBuilder;
111 use jrsonnet_ir::DestructRest;109 use jrsonnet_ir::DestructRest;
112 use rustc_hash::FxHashSet;110 use rustc_hash::FxHashSet;
111
112 use crate::ObjValueBuilder;
113113
114 let captured_fields: FxHashSet<_> = fields.iter().map(|f| f.0.clone()).collect();114 let captured_fields: FxHashSet<_> = fields.iter().map(|f| f.0.clone()).collect();
115 let field_names: Vec<_> = fields115 let field_names: Vec<_> = fields
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
3use jrsonnet_gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
4use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
5use jrsonnet_ir::{5use jrsonnet_ir::{
6 function::ParamName, ArgsDesc, AssertStmt, BinaryOpType, BindSpec, CompSpec, Expr, ExprParams,6 ArgsDesc, AssertStmt, BinaryOpType, BindSpec, CompSpec, Expr, ExprParams, FieldMember,
7 FieldMember, FieldName, ForSpecData, IfSpecData, ImportKind, LiteralType, ObjBody, ObjMembers,7 FieldName, ForSpecData, IfSpecData, ImportKind, LiteralType, ObjBody, ObjMembers, Spanned,
8 Spanned,8 function::ParamName,
9};9};
10use jrsonnet_types::ValType;10use jrsonnet_types::ValType;
11use rustc_hash::FxHashMap;11use rustc_hash::FxHashMap;
1212
13use self::destructure::destruct;13use self::destructure::destruct;
14use crate::{14use crate::{
15 Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result, ResultExt,
16 SupThis, Unbound, Val,
15 arr::ArrValue,17 arr::ArrValue,
16 bail,18 bail,
17 destructure::evaluate_dest,19 destructure::evaluate_dest,
18 error::{suggest_object_fields, ErrorKind::*},20 error::{ErrorKind::*, suggest_object_fields},
19 evaluate::operator::{evaluate_binary_op_special, evaluate_unary_op},21 evaluate::operator::{evaluate_binary_op_special, evaluate_unary_op},
20 function::{CallLocation, FuncDesc, FuncVal},22 function::{CallLocation, FuncDesc, FuncVal},
21 gc::WithCapacityExt as _,23 gc::WithCapacityExt as _,
22 in_frame,24 in_frame,
23 typed::{FromUntyped, IntoUntyped as _, Typed},25 typed::{FromUntyped, IntoUntyped as _, Typed},
24 val::{CachedUnbound, IndexableVal, NumValue, StrValue, Thunk},26 val::{CachedUnbound, IndexableVal, NumValue, StrValue, Thunk},
25 with_state, Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result,27 with_state,
26 ResultExt, SupThis, Unbound, Val,
27};28};
28pub mod destructure;29pub mod destructure;
29pub mod operator;30pub mod operator;
modifiedcrates/jrsonnet-evaluator/src/evaluate/operator.rsdiffbeforeafterboth
3use jrsonnet_ir::{BinaryOpType, Expr, UnaryOpType};3use jrsonnet_ir::{BinaryOpType, Expr, UnaryOpType};
44
5use crate::{5use crate::{
6 Context, Result, Val,
6 arr::ArrValue,7 arr::ArrValue,
7 bail,8 bail,
8 error::ErrorKind::*,9 error::ErrorKind::*,
9 evaluate,10 evaluate,
10 stdlib::std_format,11 stdlib::std_format,
11 typed::IntoUntyped as _,12 typed::IntoUntyped as _,
12 val::{equals, StrValue},13 val::{StrValue, equals},
13 Context, Result, Val,
14};14};
1515
16pub fn evaluate_unary_op(op: UnaryOpType, b: &Val) -> Result<Val> {16pub fn evaluate_unary_op(op: UnaryOpType, b: &Val) -> Result<Val> {
modifiedcrates/jrsonnet-evaluator/src/function/builtin.rsdiffbeforeafterboth
1use std::any::Any;1use std::any::Any;
22
3use jrsonnet_gcmodule::{cc_dyn, Trace, TraceBox};3use jrsonnet_gcmodule::{Trace, TraceBox, cc_dyn};
4use jrsonnet_ir::function::{FunctionSignature, ParamDefault, ParamName, ParamParse};4use jrsonnet_ir::function::{FunctionSignature, ParamDefault, ParamName, ParamParse};
55
6use super::CallLocation;6use super::CallLocation;
modifiedcrates/jrsonnet-evaluator/src/function/mod.rsdiffbeforeafterboth
9use self::{9use self::{
10 builtin::{Builtin, StaticBuiltin},10 builtin::{Builtin, StaticBuiltin},
11 parse::{parse_builtin_call, parse_default_function_call, parse_function_call},11 parse::{parse_builtin_call, parse_default_function_call, parse_function_call},
12 prepared::{parse_prepared_builtin_call, parse_prepared_function_call, PreparedCall},12 prepared::{PreparedCall, parse_prepared_builtin_call, parse_prepared_function_call},
13};13};
14use crate::{14use crate::{
15 bail, error::ErrorKind::*, evaluate, evaluate_trivial, function::builtin::BuiltinFunc, Context,15 Context, Result, Thunk, Val, bail, error::ErrorKind::*, evaluate, evaluate_trivial,
16 Result, Thunk, Val,16 function::builtin::BuiltinFunc,
17};17};
1818
19pub mod builtin;19pub mod builtin;
20mod native;20mod native;
21mod parse;21mod parse;
22mod prepared;22mod prepared;
2323
24pub use jrsonnet_ir::function::*;
24pub use native::NativeFn;25pub use native::NativeFn;
25pub use prepared::PreparedFuncVal;26pub use prepared::PreparedFuncVal;
26
27pub use jrsonnet_ir::function::*;
2827
29/// Function callsite location.28/// Function callsite location.
30/// Either from other jsonnet code, specified by expression location, or from native (without location).29/// Either from other jsonnet code, specified by expression location, or from native (without location).
modifiedcrates/jrsonnet-evaluator/src/function/native.rsdiffbeforeafterboth
1use std::marker::PhantomData;1use std::marker::PhantomData;
22
3use jrsonnet_gcmodule::Trace;3use jrsonnet_gcmodule::Trace;
4use jrsonnet_types::{ComplexValType, ValType};
45
5use super::PreparedFuncVal;6use super::PreparedFuncVal;
6use crate::{7use crate::{
8 CallLocation, Result, Val,
7 function::FuncVal,9 function::FuncVal,
8 typed::{FromUntyped, IntoUntyped, Typed},10 typed::{FromUntyped, IntoUntyped, Typed},
9 CallLocation, Result, Val,
10};11};
11use jrsonnet_types::{ComplexValType, ValType};
1212
13#[derive(Debug, Trace, Clone)]13#[derive(Debug, Trace, Clone)]
14pub struct NativeFn<D: 'static>(pub(crate) PreparedFuncVal, PhantomData<D>);14pub struct NativeFn<D: 'static>(pub(crate) PreparedFuncVal, PhantomData<D>);
modifiedcrates/jrsonnet-evaluator/src/function/parse.rsdiffbeforeafterboth
1use std::rc::Rc;1use std::rc::Rc;
22
3use jrsonnet_ir::{3use jrsonnet_ir::{
4 ArgsDesc, Expr, ExprParams,
4 function::{FunctionSignature, ParamName},5 function::{FunctionSignature, ParamName},
5 ArgsDesc, Expr, ExprParams,
6};6};
7use rustc_hash::FxHashMap;7use rustc_hash::FxHashMap;
88
9use crate::{9use crate::{
10 bail,10 Context, Pending, Thunk, Val, bail,
11 destructure::destruct,11 destructure::destruct,
12 error::{ErrorKind::*, Result},12 error::{ErrorKind::*, Result},
13 evaluate, evaluate_named_param,13 evaluate, evaluate_named_param,
14 gc::WithCapacityExt as _,14 gc::WithCapacityExt as _,
15 Context, Pending, Thunk, Val,
16};15};
1716
18fn eval_arg(ctx: Context, arg: &Rc<Expr>, tailstrict: bool) -> Result<Thunk<Val>> {17fn eval_arg(ctx: Context, arg: &Rc<Expr>, tailstrict: bool) -> Result<Thunk<Val>> {
modifiedcrates/jrsonnet-evaluator/src/function/prepared.rsdiffbeforeafterboth
1use std::rc::Rc;1use std::rc::Rc;
22
3use jrsonnet_gcmodule::{Acyclic, Trace};3use jrsonnet_gcmodule::{Acyclic, Trace};
4use jrsonnet_ir::function::FunctionSignature;
5use jrsonnet_ir::{ExprParams, IStr};4use jrsonnet_ir::{ExprParams, IStr, function::FunctionSignature};
6use rustc_hash::{FxHashMap, FxHashSet};5use rustc_hash::{FxHashMap, FxHashSet};
76
8use crate::destructure::destruct;7use super::{CallLocation, FuncVal};
9use crate::gc::WithCapacityExt;
10use crate::{bail, error::ErrorKind::*, Result};8use crate::{
11use crate::{evaluate_named_param, Context, ContextBuilder, Pending, Thunk, Val};9 Context, ContextBuilder, Pending, Result, Thunk, Val, bail, destructure::destruct,
1210 error::ErrorKind::*, evaluate_named_param, gc::WithCapacityExt,
13use super::{CallLocation, FuncVal};11};
1412
15#[derive(Debug, Trace, Clone)]13#[derive(Debug, Trace, Clone)]
16pub struct PreparedFuncVal {14pub struct PreparedFuncVal {
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
22
3use jrsonnet_interner::IStr;3use jrsonnet_interner::IStr;
4use serde::{4use serde::{
5 Deserialize, Serialize, Serializer,
5 de::{self, Visitor},6 de::{self, Visitor},
6 ser::{7 ser::{
7 Error, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,8 Error, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
8 SerializeTupleStruct, SerializeTupleVariant,9 SerializeTupleStruct, SerializeTupleVariant,
9 },10 },
10 Deserialize, Serialize, Serializer,
11};11};
1212
13use crate::{13use crate::{
14 arr::ArrValue, in_description_frame, runtime_error, val::NumValue, Error as JrError, ObjValue,14 Error as JrError, ObjValue, ObjValueBuilder, Result, Val, arr::ArrValue, in_description_frame,
15 ObjValueBuilder, Result, Val,15 runtime_error, val::NumValue,
16};16};
1717
18impl<'de> Deserialize<'de> for Val {18impl<'de> Deserialize<'de> for Val {
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
40pub use evaluate::*;40pub use evaluate::*;
41use function::CallLocation;41use function::CallLocation;
42pub use import::*;42pub use import::*;
43use jrsonnet_gcmodule::{cc_dyn, Cc, Trace};43use jrsonnet_gcmodule::{Cc, Trace, cc_dyn};
44pub use jrsonnet_interner::{IBytes, IStr};44pub use jrsonnet_interner::{IBytes, IStr};
45pub use jrsonnet_ir as parser;45pub use jrsonnet_ir as parser;
46use jrsonnet_ir::{Expr, Source, SourcePath};46use jrsonnet_ir::{Expr, Source, SourcePath};
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
1use std::{borrow::Cow, fmt::Write, ptr};1use std::{borrow::Cow, fmt::Write, ptr};
22
3use crate::{bail, in_description_frame, Result, ResultExt, Val};3use crate::{Result, ResultExt, Val, bail, in_description_frame};
44
5pub trait ManifestFormat {5pub trait ManifestFormat {
6 fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()>;6 fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()>;
modifiedcrates/jrsonnet-evaluator/src/map.rsdiffbeforeafterboth
2use jrsonnet_interner::IStr;2use jrsonnet_interner::IStr;
3use rustc_hash::FxHashMap;3use rustc_hash::FxHashMap;
44
5use crate::{gc::WithCapacityExt as _, Thunk, Val};5use crate::{Thunk, Val, gc::WithCapacityExt as _};
66
7#[derive(Trace, Debug)]7#[derive(Trace, Debug)]
8#[trace(tracking(force))]8#[trace(tracking(force))]
modifiedcrates/jrsonnet-evaluator/src/obj/mod.rsdiffbeforeafterboth
11};11};
1212
13use educe::Educe;13use educe::Educe;
14use jrsonnet_gcmodule::{cc_dyn, Acyclic, Cc, Trace, Weak};14use jrsonnet_gcmodule::{Acyclic, Cc, Trace, Weak, cc_dyn};
15use jrsonnet_interner::IStr;15use jrsonnet_interner::IStr;
16use jrsonnet_ir::Span;16use jrsonnet_ir::Span;
17use rustc_hash::{FxHashMap, FxHashSet};17use rustc_hash::{FxHashMap, FxHashSet};
22pub use oop::ObjValueBuilder;22pub use oop::ObjValueBuilder;
2323
24use crate::{24use crate::{
25 CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
25 arr::{PickObjectKeyValues, PickObjectValues},26 arr::{PickObjectKeyValues, PickObjectValues},
26 bail,27 bail,
27 error::{suggest_object_fields, ErrorKind::*},28 error::{ErrorKind::*, suggest_object_fields},
28 identity_hash,29 identity_hash,
29 operator::evaluate_add_op,30 operator::evaluate_add_op,
30 val::{ArrValue, ThunkValue},31 val::{ArrValue, ThunkValue},
31 CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
32};32};
3333
34#[cfg(not(feature = "exp-preserve-order"))]34#[cfg(not(feature = "exp-preserve-order"))]
modifiedcrates/jrsonnet-evaluator/src/obj/oop.rsdiffbeforeafterboth
1use std::cell::{Cell, RefCell};1use std::{
2use std::ops::ControlFlow;2 cell::{Cell, RefCell},
3use std::{fmt, mem};3 fmt, mem,
44 ops::ControlFlow,
5use crate::function::{CallLocation, FuncVal};5};
6use crate::gc::WithCapacityExt as _;6
7use crate::{
8 bail, error::ErrorKind::*, in_frame, CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
9};
10use jrsonnet_gcmodule::{Cc, Trace};7use jrsonnet_gcmodule::{Cc, Trace};
11use jrsonnet_ir::IStr;8use jrsonnet_ir::IStr;
12use rustc_hash::{FxHashMap, FxHashSet};9use rustc_hash::{FxHashMap, FxHashSet};
1310
14use super::ordering::{FieldIndex, SuperDepth};
15use super::{11use super::{
16 CcObjectAssertion, CcObjectCore, EnumFields, EnumFieldsHandler, FieldVisibility, GetFor,12 CcObjectAssertion, CcObjectCore, EnumFields, EnumFieldsHandler, FieldVisibility, GetFor,
17 HasFieldIncludeHidden, ObjMember, ObjMemberBuilder, ObjValue, ObjValueInner, ObjectAssertion,13 HasFieldIncludeHidden, ObjMember, ObjMemberBuilder, ObjValue, ObjValueInner, ObjectAssertion,
18 ObjectCore, OmitFieldsCore, SupThis,14 ObjectCore, OmitFieldsCore, SupThis,
15 ordering::{FieldIndex, SuperDepth},
19};16};
17use crate::{
18 CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val, bail,
19 error::ErrorKind::*,
20 function::{CallLocation, FuncVal},
21 gc::WithCapacityExt as _,
22 in_frame,
23};
2024
21#[allow(clippy::module_name_repetitions)]25#[allow(clippy::module_name_repetitions)]
22#[derive(Trace, Default)]26#[derive(Trace, Default)]
modifiedcrates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth
7use thiserror::Error;7use thiserror::Error;
88
9use crate::{9use crate::{
10 bail,10 Error, ObjValue, Result, Val, bail,
11 error::{format_found, suggest_object_fields, ErrorKind::*},11 error::{ErrorKind::*, format_found, suggest_object_fields},
12 typed::FromUntyped,12 typed::FromUntyped,
13 Error, ObjValue, Result, Val,
14};13};
1514
16#[derive(Debug, Clone, Error, Trace)]15#[derive(Debug, Clone, Error, Trace)]
modifiedcrates/jrsonnet-evaluator/src/stdlib/mod.rsdiffbeforeafterboth
33
4use format::{format_arr, format_obj};4use format::{format_arr, format_obj};
55
6use crate::{function::CallLocation, in_frame, Result, Val};6use crate::{Result, Val, function::CallLocation, in_frame};
77
8pub mod format;8pub mod format;
99
modifiedcrates/jrsonnet-evaluator/src/tla.rsdiffbeforeafterboth
5use jrsonnet_ir::{SourceFifo, SourcePath};5use jrsonnet_ir::{SourceFifo, SourcePath};
66
7use crate::{7use crate::{
8 Result, Thunk, Val,
8 function::{CallLocation, PreparedFuncVal},9 function::{CallLocation, PreparedFuncVal},
9 in_description_frame, with_state, Result, Thunk, Val,10 in_description_frame, with_state,
10};11};
1112
12#[derive(Clone, Trace)]13#[derive(Clone, Trace)]
modifiedcrates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth
10#[cfg(feature = "explaining-traces")]10#[cfg(feature = "explaining-traces")]
11use jrsonnet_ir::Span;11use jrsonnet_ir::Span;
1212
13use crate::{error::ErrorKind, Error};13use crate::{Error, error::ErrorKind};
1414
15/// The way paths should be displayed15/// The way paths should be displayed
16#[derive(Clone, Trace)]16#[derive(Clone, Trace)]
258 struct ResetData {258 struct ResetData {
259 loc: Span,259 loc: Span,
260 }260 }
261 use hi_doc::{source_to_ansi, Formatting, SnippetBuilder, Text};261 use hi_doc::{Formatting, SnippetBuilder, Text, source_to_ansi};
262262
263 write!(out, "{}", error.error())?;263 write!(out, "{}", error.error())?;
264 if let ErrorKind::ImportSyntaxError { path, error } = error.error() {264 if let ErrorKind::ImportSyntaxError { path, error } = error.error() {
modifiedcrates/jrsonnet-evaluator/src/typed/conversions.rsdiffbeforeafterboth
5use jrsonnet_types::{ComplexValType, ValType};5use jrsonnet_types::{ComplexValType, ValType};
66
7use crate::{7use crate::{
8 ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val,
8 arr::{ArrValue, BytesArray},9 arr::{ArrValue, BytesArray},
9 bail,10 bail,
10 function::FuncVal,11 function::FuncVal,
11 typed::CheckType,12 typed::CheckType,
12 val::{IndexableVal, NumValue, StrValue, ThunkMapper},13 val::{IndexableVal, NumValue, StrValue, ThunkMapper},
13 ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val,
14};14};
1515
16#[doc(hidden)]16#[doc(hidden)]
17pub mod __typed_macro_prelude {17pub mod __typed_macro_prelude {
18 pub use ::jrsonnet_evaluator::{18 pub use ::jrsonnet_evaluator::{
19 IStr, ObjValue, ObjValueBuilder, State, Val,
19 error::{ErrorKind, Result as JrResult},20 error::{ErrorKind, Result as JrResult},
20 typed::{21 typed::{
21 CheckType, ComplexValType, FromUntyped, IntoUntyped, ParseTypedObj, SerializeTypedObj,22 CheckType, ComplexValType, FromUntyped, IntoUntyped, ParseTypedObj, SerializeTypedObj,
22 Typed,23 Typed,
23 },24 },
24 IStr, ObjValue, ObjValueBuilder, State, Val,
25 };25 };
26}26}
27pub use jrsonnet_macros::{FromUntyped, IntoUntyped, Typed};27pub use jrsonnet_macros::{FromUntyped, IntoUntyped, Typed};
modifiedcrates/jrsonnet-evaluator/src/typed/mod.rsdiffbeforeafterboth
7use thiserror::Error;7use thiserror::Error;
88
9use crate::{9use crate::{
10 Val,
10 error::{Error, ErrorKind, Result},11 error::{Error, ErrorKind, Result},
11 in_description_frame, Val,12 in_description_frame,
12};13};
1314
14#[derive(Debug, Error, Clone, Acyclic)]15#[derive(Debug, Error, Clone, Acyclic)]
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
9 rc::Rc,9 rc::Rc,
10};10};
1111
12use jrsonnet_gcmodule::{cc_dyn, Acyclic, Cc, Trace};12use jrsonnet_gcmodule::{Acyclic, Cc, Trace, cc_dyn};
13use jrsonnet_interner::IStr;13use jrsonnet_interner::IStr;
14pub use jrsonnet_macros::Thunk;14pub use jrsonnet_macros::Thunk;
15use jrsonnet_types::ValType;15use jrsonnet_types::ValType;
1818
19pub use crate::arr::{ArrValue, ArrayLike};19pub use crate::arr::{ArrValue, ArrayLike};
20use crate::{20use crate::{
21 bail,21 ObjValue, Result, SupThis, Unbound, WeakSupThis, bail,
22 error::{Error, ErrorKind::*},22 error::{Error, ErrorKind::*},
23 function::FuncVal,23 function::FuncVal,
24 gc::WithCapacityExt as _,24 gc::WithCapacityExt as _,
25 manifest::{ManifestFormat, ToStringFormat},25 manifest::{ManifestFormat, ToStringFormat},
26 typed::{BoundedUsize, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER},26 typed::{BoundedUsize, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER},
27 ObjValue, Result, SupThis, Unbound, WeakSupThis,
28};27};
2928
30pub trait ThunkValue: Trace {29pub trait ThunkValue: Trace {
modifiedcrates/jrsonnet-formatter/src/children.rsdiffbeforeafterboth
3use std::{fmt::Debug, mem};3use std::{fmt::Debug, mem};
44
5use jrsonnet_rowan_parser::{5use jrsonnet_rowan_parser::{
6 AstNode, AstToken, SyntaxElement, SyntaxNode, TS,
6 nodes::{CustomError, Trivia, TriviaKind},7 nodes::{CustomError, Trivia, TriviaKind},
7 AstNode, AstToken, SyntaxElement, SyntaxNode, TS,
8};8};
99
10pub type ChildTrivia = Vec<Result<Trivia, String>>;10pub type ChildTrivia = Vec<Result<Trivia, String>>;
modifiedcrates/jrsonnet-formatter/src/comments.rsdiffbeforeafterboth
1use std::string::String;1use std::string::String;
22
3use dprint_core::formatting::PrintItems;3use dprint_core::formatting::PrintItems;
4use jrsonnet_rowan_parser::{nodes::TriviaKind, AstToken};4use jrsonnet_rowan_parser::{AstToken, nodes::TriviaKind};
55
6use crate::{children::ChildTrivia, p, pi};6use crate::{children::ChildTrivia, p, pi};
77
modifiedcrates/jrsonnet-formatter/src/lib.rsdiffbeforeafterboth
22
3use children::{children_between, trivia_before};3use children::{children_between, trivia_before};
4use dprint_core::formatting::{4use dprint_core::formatting::{
5 ConditionResolver, ConditionResolverContext, LineNumber, PrintItems, PrintOptions,
5 condition_helpers::is_multiple_lines,6 condition_helpers::is_multiple_lines,
6 condition_resolvers::true_resolver,7 condition_resolvers::true_resolver,
7 ir_helpers::{new_line_group, with_indent},8 ir_helpers::{new_line_group, with_indent},
8 ConditionResolver, ConditionResolverContext, LineNumber, PrintItems, PrintOptions,
9};9};
10use hi_doc::{Formatting, SnippetBuilder};10use hi_doc::{Formatting, SnippetBuilder};
11use jrsonnet_lexer::collect_lexed_str_block;11use jrsonnet_lexer::collect_lexed_str_block;
12use jrsonnet_rowan_parser::{12use jrsonnet_rowan_parser::{
13 AstNode, AstToken as _, SyntaxToken,
13 nodes::{14 nodes::{
14 Arg, ArgsDesc, Assertion, BinaryOperator, Bind, CompSpec, Destruct, DestructArrayPart,15 Arg, ArgsDesc, Assertion, BinaryOperator, Bind, CompSpec, Destruct, DestructArrayPart,
15 DestructRest, Expr, ExprArray, ExprBase, FieldName, ForSpec, IfSpec, ImportKind, Literal,16 DestructRest, Expr, ExprArray, ExprBase, FieldName, ForSpec, IfSpec, ImportKind, Literal,
16 Member, Name, Number, ObjBody, ObjLocal, ParamsDesc, SliceDesc, SourceFile, Stmt, Suffix,17 Member, Name, Number, ObjBody, ObjLocal, ParamsDesc, SliceDesc, SourceFile, Stmt, Suffix,
17 Text, TextKind, UnaryOperator, Visibility,18 Text, TextKind, UnaryOperator, Visibility,
18 },19 },
19 AstNode, AstToken as _, SyntaxToken,
20};20};
2121
22use crate::{22use crate::{
23 children::{trivia_after, Child, EndingComments},23 children::{Child, EndingComments, trivia_after},
24 comments::{format_comments, CommentLocation},24 comments::{CommentLocation, format_comments},
25};25};
2626
27mod children;27mod children;
modifiedcrates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth
14 str,14 str,
15};15};
1616
17use hashbrown::{hash_map::RawEntryMut, HashMap};17use hashbrown::{HashMap, hash_map::RawEntryMut};
18use jrsonnet_gcmodule::{Acyclic, Trace};18use jrsonnet_gcmodule::{Acyclic, Trace};
19use rustc_hash::FxBuildHasher;19use rustc_hash::FxBuildHasher;
2020
242pub mod interop {242pub mod interop {
243 use std::mem;243 use std::mem;
244244
245 use crate::{PoolMap, POOL};245 use crate::{POOL, PoolMap};
246246
247 /// Type-erased interned string pool247 /// Type-erased interned string pool
248 pub enum PoolState {}248 pub enum PoolState {}
modifiedcrates/jrsonnet-ir-parser/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "jrsonnet-ir-parser"2name = "jrsonnet-ir-parser"
3description = "Jrsonnet hand-rolled parser which parses source directly into IR"
3authors.workspace = true4authors.workspace = true
4edition.workspace = true5edition.workspace = true
5license.workspace = true6license.workspace = true
modifiedcrates/jrsonnet-ir-parser/src/lib.rsdiffbeforeafterboth
22
3use jrsonnet_gcmodule::Acyclic;3use jrsonnet_gcmodule::Acyclic;
4use jrsonnet_ir::{4use jrsonnet_ir::{
5 unescape, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec,5 ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec, Destruct, Expr,
6 Destruct, Expr, ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse,6 ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse, IfSpecData,
7 IfSpecData, ImportKind, IndexPart, LiteralType, Member, ObjBody, ObjComp, ObjMembers, Slice,7 ImportKind, IndexPart, LiteralType, Member, ObjBody, ObjComp, ObjMembers, Slice, SliceDesc,
8 SliceDesc, Source, Span, Spanned, UnaryOpType, Visibility,8 Source, Span, Spanned, UnaryOpType, Visibility, unescape,
9};9};
10use jrsonnet_lexer::{collect_lexed_str_block, Lexeme, Lexer, SyntaxKind, T};10use jrsonnet_lexer::{Lexeme, Lexer, SyntaxKind, T, collect_lexed_str_block};
1111
12pub struct ParserSettings {12pub struct ParserSettings {
13 pub source: Source,13 pub source: Source,
modifiedcrates/jrsonnet-ir/src/function.rsdiffbeforeafterboth
1use std::fmt;1use std::{fmt, ops::Deref, rc::Rc};
2use std::ops::Deref;
3use std::rc::Rc;
42
5use jrsonnet_gcmodule::Acyclic;3use jrsonnet_gcmodule::Acyclic;
6use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
modifiedcrates/jrsonnet-ir/src/location.rsdiffbeforeafterboth
8585
86#[cfg(test)]86#[cfg(test)]
87pub mod tests {87pub mod tests {
88 use super::{offset_to_location, CodeLocation};88 use super::{CodeLocation, offset_to_location};
8989
90 #[test]90 #[test]
91 fn test() {91 fn test() {
modifiedcrates/jrsonnet-ir/src/source.rsdiffbeforeafterboth
9use jrsonnet_gcmodule::Acyclic;9use jrsonnet_gcmodule::Acyclic;
10use jrsonnet_interner::{IBytes, IStr};10use jrsonnet_interner::{IBytes, IStr};
1111
12use crate::location::{location_to_offset, offset_to_location, CodeLocation};12use crate::location::{CodeLocation, location_to_offset, offset_to_location};
1313
14macro_rules! any_ext_methods {14macro_rules! any_ext_methods {
15 ($T:ident) => {15 ($T:ident) => {
302}302}
303impl fmt::Debug for Source {303impl fmt::Debug for Source {
304 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {304 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
305 write!(f, "{:?}", self.0 .0)305 write!(f, "{:?}", self.0.0)
306 }306 }
307}307}
308308
modifiedcrates/jrsonnet-lexer/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "jrsonnet-lexer"2name = "jrsonnet-lexer"
3description = "Jrsonnet lexer shared between rowan and hand-rolled parser"
3authors.workspace = true4authors.workspace = true
4edition.workspace = true5edition.workspace = true
5license.workspace = true6license.workspace = true
modifiedcrates/jrsonnet-lexer/src/lex.rsdiffbeforeafterboth
4// use rowan::{TextRange, TextSize};5// use rowan::{TextRange, TextSize};
5
6use crate::{6use crate::{
7 Span,
7 generated::syntax_kinds::SyntaxKind,8 generated::syntax_kinds::SyntaxKind,
8 string_block::{lex_str_block, StringBlockError},9 string_block::{StringBlockError, lex_str_block},
9 Span,
10};10};
1111
12pub struct Lexer<'a> {12pub struct Lexer<'a> {
modifiedcrates/jrsonnet-lexer/src/lib.rsdiffbeforeafterboth
77
8pub use generated::syntax_kinds::SyntaxKind;8pub use generated::syntax_kinds::SyntaxKind;
9pub use lex::{Lexeme, Lexer};9pub use lex::{Lexeme, Lexer};
10pub use string_block::{collect_lexed_str_block, CollectStrBlock};10pub use string_block::{CollectStrBlock, collect_lexed_str_block};
1111
modifiedcrates/jrsonnet-lexer/src/string_block.rsdiffbeforeafterboth
6 MissingIndent,6 MissingIndent,
7}7}
88
9use logos::Lexer;9use StringBlockError::*;
10use StringBlockError::*;10use logos::Lexer;
1111
12use crate::generated::syntax_kinds::SyntaxKind;12use crate::generated::syntax_kinds::SyntaxKind;
1313
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
3use proc_macro2::TokenStream;3use proc_macro2::TokenStream;
4use quote::{quote, quote_spanned};4use quote::{quote, quote_spanned};
5use syn::{5use syn::{
6 parenthesized,
7 parse::{Parse, ParseStream},
8 parse_macro_input,
9 punctuated::Punctuated,
10 spanned::Spanned,
11 token::Comma,
12 Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,6 Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,
13 LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type,7 LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type, parenthesized,
8 parse::{Parse, ParseStream},
9 parse_macro_input,
10 punctuated::Punctuated,
11 spanned::Spanned,
12 token::Comma,
14};13};
1514
16use self::typed::{derive_from_untyped_inner, derive_into_untyped_inner, derive_typed_inner};15use self::typed::{derive_from_untyped_inner, derive_into_untyped_inner, derive_typed_inner};
modifiedcrates/jrsonnet-macros/src/typed.rsdiffbeforeafterboth
1use crate::names::Names;
2use crate::{extract_type_from_option, kw, parse_attr, type_is_path};
3use proc_macro2::TokenStream;1use proc_macro2::TokenStream;
4use quote::quote;2use quote::quote;
5use syn::parse::{Parse, ParseStream};3use syn::{
6use syn::spanned::Spanned as _;4 DeriveInput, Error, Ident, LitStr, Result, Token, Type, parenthesized,
5 parse::{Parse, ParseStream},
6 spanned::Spanned as _,
7 token,
8};
9
7use syn::{parenthesized, token, DeriveInput, Error, Ident, LitStr, Result, Token, Type};10use crate::{extract_type_from_option, kw, names::Names, parse_attr, type_is_path};
811
9#[derive(Default)]12#[derive(Default)]
10#[allow(clippy::struct_excessive_bools)]13#[allow(clippy::struct_excessive_bools)]
modifiedcrates/jrsonnet-peg-parser/src/lib.rsdiffbeforeafterboth
1use std::rc::Rc;
2
1use jrsonnet_gcmodule::Acyclic;3use jrsonnet_gcmodule::Acyclic;
2use jrsonnet_ir::{4use jrsonnet_ir::{
3 unescape, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BindSpec, CompSpec, Destruct,5 ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BindSpec, CompSpec, Destruct, DestructRest, Expr,
4 DestructRest, Expr, ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse,6 ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse, IfSpecData,
5 IfSpecData, ImportKind, IndexPart, LiteralType, Member, ObjBody, ObjComp, ObjMembers, Slice,7 ImportKind, IndexPart, LiteralType, Member, ObjBody, ObjComp, ObjMembers, Slice, SliceDesc,
6 SliceDesc, Source, Span, Spanned, Visibility,8 Source, Span, Spanned, Visibility, unescape,
7};9};
8use peg::parser;10use peg::parser;
9use std::rc::Rc;
1011
11pub struct ParserSettings {12pub struct ParserSettings {
12 pub source: Source,13 pub source: Source,
58 rule id() -> IStr = v:$(quiet!{ !reserved() alpha() (alpha() / digit())*} / expected!("<identifier>")) { v.into() }59 rule id() -> IStr = v:$(quiet!{ !reserved() alpha() (alpha() / digit())*} / expected!("<identifier>")) { v.into() }
5960
60 rule keyword(id: &'static str) -> ()61 rule keyword(id: &'static str) -> ()
61 = ##parse_string_literal(id) end_of_ident()62 = #parse_string_literal(id) end_of_ident()
6263
63 pub rule param(s: &ParserSettings) -> ExprParam = destruct:destruct(s) expr:(_ "=" _ expr:expr(s){expr})? { ExprParam { destruct, default: expr.map(Rc::new) } }64 pub rule param(s: &ParserSettings) -> ExprParam = destruct:destruct(s) expr:(_ "=" _ expr:expr(s){expr})? { ExprParam { destruct, default: expr.map(Rc::new) } }
64 pub rule params(s: &ParserSettings) -> ExprParams65 pub rule params(s: &ParserSettings) -> ExprParams
429 use insta::{assert_snapshot, glob};430 use insta::{assert_snapshot, glob};
430 use jrsonnet_ir::{IStr, Source};431 use jrsonnet_ir::{IStr, Source};
431432
432 use crate::{parse, ParserSettings};433 use crate::{ParserSettings, parse};
433434
434 #[test]435 #[test]
435 fn snapshots() {436 fn snapshots() {
modifiedcrates/jrsonnet-rowan-parser/src/event.rsdiffbeforeafterboth
3use rowan::{GreenNodeBuilder, Language, TextRange, TextSize};3use rowan::{GreenNodeBuilder, Language, TextRange, TextSize};
44
5use crate::{5use crate::{
6 AstToken, JsonnetLanguage, SyntaxKind,
6 lex::Lexeme,7 lex::Lexeme,
7 nodes::Trivia,8 nodes::Trivia,
8 parser::{LocatedSyntaxError, Parse, SyntaxError},9 parser::{LocatedSyntaxError, Parse, SyntaxError},
9 AstToken, JsonnetLanguage, SyntaxKind,
10};10};
1111
12#[derive(Clone, Debug)]12#[derive(Clone, Debug)]
modifiedcrates/jrsonnet-rowan-parser/src/generated/nodes.rsdiffbeforeafterboth
33
4#![allow(non_snake_case, clippy::match_like_matches_macro)]4#![allow(non_snake_case, clippy::match_like_matches_macro)]
5use crate::{5use crate::{
6 ast::{support, AstChildren, AstNode, AstToken},
7 SyntaxKind::{self, *},6 SyntaxKind::{self, *},
8 SyntaxNode, SyntaxToken, T,7 SyntaxNode, SyntaxToken, T,
8 ast::{AstChildren, AstNode, AstToken, support},
9};9};
1010
11#[derive(Debug, Clone, PartialEq, Eq, Hash)]11#[derive(Debug, Clone, PartialEq, Eq, Hash)]
modifiedcrates/jrsonnet-rowan-parser/src/marker.rsdiffbeforeafterboth
3use drop_bomb::DropBomb;3use drop_bomb::DropBomb;
44
5use crate::{5use crate::{
6 SyntaxKind,
6 event::Event,7 event::Event,
7 parser::{ExpectedSyntax, Parser, SyntaxError},8 parser::{ExpectedSyntax, Parser, SyntaxError},
8 SyntaxKind,
9};9};
1010
11// pub struct Ranger {11// pub struct Ranger {
modifiedcrates/jrsonnet-rowan-parser/src/parser.rsdiffbeforeafterboth
3use rowan::{GreenNode, TextRange};3use rowan::{GreenNode, TextRange};
44
5use crate::{5use crate::{
6 AstToken, SyntaxKind,
7 SyntaxKind::*,
8 SyntaxNode, T, TS,
6 event::Event,9 event::Event,
7 marker::{CompletedMarker, Marker},10 marker::{CompletedMarker, Marker},
8 nodes::{BinaryOperatorKind, Literal, Number, Text, UnaryOperatorKind},11 nodes::{BinaryOperatorKind, Literal, Number, Text, UnaryOperatorKind},
9 token_set::SyntaxKindSet,12 token_set::SyntaxKindSet,
10 AstToken, SyntaxKind,
11 SyntaxKind::*,
12 SyntaxNode, T, TS,
13};13};
1414
15pub struct Parse {15pub struct Parse {
modifiedcrates/jrsonnet-rowan-parser/src/tests.rsdiffbeforeafterboth
33
4use hi_doc::{Formatting, SnippetBuilder, Text};4use hi_doc::{Formatting, SnippetBuilder, Text};
55
6use crate::{parse, AstNode};6use crate::{AstNode, parse};
77
8fn process(text: &str) -> String {8fn process(text: &str) -> String {
9 use std::fmt::Write;9 use std::fmt::Write;
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth

no syntactic changes

modifiedcrates/jrsonnet-stdlib/src/arrays.rsdiffbeforeafterboth
1#![allow(non_snake_case)]1#![allow(non_snake_case)]
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail,4 Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val, bail,
5 function::{builtin, FuncVal, NativeFn},5 function::{FuncVal, NativeFn, builtin},
6 runtime_error,6 runtime_error,
7 typed::{BoundedI32, BoundedUsize, Either2, FromUntyped},7 typed::{BoundedI32, BoundedUsize, Either2, FromUntyped},
8 val::{equals, ArrValue, IndexableVal},8 val::{ArrValue, IndexableVal, equals},
9 Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val,
10};9};
1110
12pub fn eval_on_empty(on_empty: Option<Thunk<Val>>) -> Result<Val> {11pub fn eval_on_empty(on_empty: Option<Thunk<Val>>) -> Result<Val> {
modifiedcrates/jrsonnet-stdlib/src/compat.rsdiffbeforeafterboth
1use std::cmp::Ordering;1use std::cmp::Ordering;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 function::builtin, operator::evaluate_compare_op, val::ArrValue, Result, Val,4 Result, Val, function::builtin, operator::evaluate_compare_op, val::ArrValue,
5};5};
66
7#[builtin]7#[builtin]
modifiedcrates/jrsonnet-stdlib/src/encoding.rsdiffbeforeafterboth
1use base64::{engine::general_purpose::STANDARD, Engine};1use base64::{Engine, engine::general_purpose::STANDARD};
2use jrsonnet_evaluator::{2use jrsonnet_evaluator::{
3 bail,3 IBytes, IStr, Result, bail,
4 function::builtin,4 function::builtin,
5 runtime_error,5 runtime_error,
6 typed::{Either, Either2},6 typed::{Either, Either2},
7 IBytes, IStr, Result,
8};7};
98
10#[builtin]9#[builtin]
modifiedcrates/jrsonnet-stdlib/src/hash.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{function::builtin, IStr};1use jrsonnet_evaluator::{IStr, function::builtin};
22
3#[builtin]3#[builtin]
4pub fn builtin_md5(s: IStr) -> String {4pub fn builtin_md5(s: IStr) -> String {
modifiedcrates/jrsonnet-stdlib/src/keyf.rsdiffbeforeafterboth
1use jrsonnet_evaluator::function::{CallLocation, FuncVal, PreparedFuncVal};
2use jrsonnet_evaluator::typed::{ComplexValType, FromUntyped, Typed, ValType};1use jrsonnet_evaluator::{
3use jrsonnet_evaluator::{Error, Result, Thunk, Val};2 Error, Result, Thunk, Val,
3 function::{CallLocation, FuncVal, PreparedFuncVal},
4 typed::{ComplexValType, FromUntyped, Typed, ValType},
5};
46
5#[derive(Default, Clone)]7#[derive(Default, Clone)]
6pub enum KeyF {8pub enum KeyF {
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
12pub use encoding::*;12pub use encoding::*;
13pub use hash::*;13pub use hash::*;
14use jrsonnet_evaluator::{14use jrsonnet_evaluator::{
15 ContextBuilder, IStr, ObjValue, ObjValueBuilder, Thunk, Val,
15 error::Result,16 error::Result,
16 function::{CallLocation, FuncVal},17 function::{CallLocation, FuncVal},
17 tla::TlaArg,18 tla::TlaArg,
18 trace::PathResolver,19 trace::PathResolver,
19 val::NumValue,20 val::NumValue,
20 ContextBuilder, IStr, ObjValue, ObjValueBuilder, Thunk, Val,
21};21};
22use jrsonnet_gcmodule::{Acyclic, Cc, Trace};22use jrsonnet_gcmodule::{Acyclic, Cc, Trace};
23use jrsonnet_ir::Source;23use jrsonnet_ir::Source;
modifiedcrates/jrsonnet-stdlib/src/manifest/ini.rsdiffbeforeafterboth
1use std::collections::BTreeMap;1use std::collections::BTreeMap;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 IStr, ObjValue, Result, ResultExt, Val,
4 manifest::{ManifestFormat, ToStringFormat},5 manifest::{ManifestFormat, ToStringFormat},
5 typed::{FromUntyped, Typed},6 typed::{FromUntyped, Typed},
6 IStr, ObjValue, Result, ResultExt, Val,
7};7};
88
9pub struct IniFormat {9pub struct IniFormat {
modifiedcrates/jrsonnet-stdlib/src/manifest/mod.rsdiffbeforeafterboth
66
7pub use ini::IniFormat;7pub use ini::IniFormat;
8use jrsonnet_evaluator::{8use jrsonnet_evaluator::{
9 IStr, ObjValue, Result, Val,
9 function::builtin,10 function::builtin,
10 manifest::{escape_string_json, JsonFormat, YamlStreamFormat},11 manifest::{JsonFormat, YamlStreamFormat, escape_string_json},
11 IStr, ObjValue, Result, Val,
12};12};
13pub use python::{PythonFormat, PythonVarsFormat};13pub use python::{PythonFormat, PythonVarsFormat};
14pub use toml::TomlFormat;14pub use toml::TomlFormat;
modifiedcrates/jrsonnet-stdlib/src/manifest/python.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{1use jrsonnet_evaluator::{
2 bail,2 Result, Val, bail,
3 manifest::{escape_string_json_buf, ManifestFormat, ToStringFormat},3 manifest::{ManifestFormat, ToStringFormat, escape_string_json_buf},
4 Result, Val,
5};4};
65
7pub struct PythonFormat {6pub struct PythonFormat {
modifiedcrates/jrsonnet-stdlib/src/manifest/toml.rsdiffbeforeafterboth
1use std::borrow::Cow;1use std::borrow::Cow;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail, in_description_frame,4 IStr, ObjValue, Result, ResultExt, Val, bail, in_description_frame,
5 manifest::{escape_string_json_buf, ManifestFormat},5 manifest::{ManifestFormat, escape_string_json_buf},
6 val::ArrValue,6 val::ArrValue,
7 IStr, ObjValue, Result, ResultExt, Val,
8};7};
98
10pub struct TomlFormat<'s> {9pub struct TomlFormat<'s> {
modifiedcrates/jrsonnet-stdlib/src/manifest/xml.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{1use jrsonnet_evaluator::{
2 bail, in_description_frame,2 Either, ObjValue, Result, ResultExt, Val, bail, in_description_frame,
3 manifest::{ManifestFormat, ToStringFormat},3 manifest::{ManifestFormat, ToStringFormat},
4 typed::{ComplexValType, Either2, FromUntyped, Typed, ValType},4 typed::{ComplexValType, Either2, FromUntyped, Typed, ValType},
5 val::ArrValue,5 val::ArrValue,
6 Either, ObjValue, Result, ResultExt, Val,
7};6};
87
9pub struct XmlJsonmlFormat {8pub struct XmlJsonmlFormat {
modifiedcrates/jrsonnet-stdlib/src/manifest/yaml.rsdiffbeforeafterboth
1use std::{borrow::Cow, fmt::Write};1use std::{borrow::Cow, fmt::Write};
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail, in_description_frame,4 Result, ResultExt, Val, bail, in_description_frame,
5 manifest::{escape_string_json_buf, ManifestFormat},5 manifest::{ManifestFormat, escape_string_json_buf},
6 Result, ResultExt, Val,
7};6};
87
9pub struct YamlFormat<'s> {8pub struct YamlFormat<'s> {
modifiedcrates/jrsonnet-stdlib/src/math.rsdiffbeforeafterboth

no syntactic changes

modifiedcrates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth
1use std::{cell::RefCell, collections::BTreeSet};1use std::{cell::RefCell, collections::BTreeSet};
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail,4 Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val, bail,
5 error::{ErrorKind::*, Result},5 error::{ErrorKind::*, Result},
6 function::{builtin, CallLocation, FuncVal},6 function::{CallLocation, FuncVal, builtin},
7 manifest::JsonFormat,7 manifest::JsonFormat,
8 typed::{Either2, Either4},8 typed::{Either2, Either4},
9 val::{equals, ArrValue},9 val::{ArrValue, equals},
10 Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val,
11};10};
12use jrsonnet_gcmodule::Cc;11use jrsonnet_gcmodule::Cc;
1312
modifiedcrates/jrsonnet-stdlib/src/objects.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{1use jrsonnet_evaluator::{
2 IStr, ObjValue, ObjValueBuilder,
2 function::builtin,3 function::builtin,
3 gc::WithCapacityExt,4 gc::WithCapacityExt,
4 rustc_hash::FxHashSet,5 rustc_hash::FxHashSet,
5 val::{ArrValue, Val},6 val::{ArrValue, Val},
6 IStr, ObjValue, ObjValueBuilder,
7};7};
88
9#[builtin]9#[builtin]
modifiedcrates/jrsonnet-stdlib/src/operator.rsdiffbeforeafterboth
2//! However, in our case we instead implement them in native, and implement native functions on top of core for backwards compatibility2//! However, in our case we instead implement them in native, and implement native functions on top of core for backwards compatibility
33
4use jrsonnet_evaluator::{4use jrsonnet_evaluator::{
5 IStr, Result, Val,
5 function::builtin,6 function::builtin,
6 operator::evaluate_mod_op,7 operator::evaluate_mod_op,
7 stdlib::std_format,8 stdlib::std_format,
8 typed::{Either, Either2},9 typed::{Either, Either2},
9 val::{equals, primitive_equals, NumValue},10 val::{NumValue, equals, primitive_equals},
10 IStr, Result, Val,
11};11};
1212
13#[builtin]13#[builtin]
modifiedcrates/jrsonnet-stdlib/src/parse.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{function::builtin, runtime_error, IStr, Result, Val};1use jrsonnet_evaluator::{IStr, Result, Val, function::builtin, runtime_error};
22
3#[builtin]3#[builtin]
4pub fn builtin_parse_json(str: IStr) -> Result<Val> {4pub fn builtin_parse_json(str: IStr) -> Result<Val> {
modifiedcrates/jrsonnet-stdlib/src/regex.rsdiffbeforeafterboth
22
3use ::regex::Regex;3use ::regex::Regex;
4use jrsonnet_evaluator::{4use jrsonnet_evaluator::{
5 IStr, ObjValue, ObjValueBuilder,
5 error::{ErrorKind::*, Result},6 error::{ErrorKind::*, Result},
6 rustc_hash::FxBuildHasher,7 rustc_hash::FxBuildHasher,
7 typed::{IntoUntyped, Typed},8 typed::{IntoUntyped, Typed},
8 val::StrValue,9 val::StrValue,
9 IStr, ObjValue, ObjValueBuilder,
10};10};
11use jrsonnet_gcmodule::Acyclic;11use jrsonnet_gcmodule::Acyclic;
12use jrsonnet_macros::builtin;12use jrsonnet_macros::builtin;
modifiedcrates/jrsonnet-stdlib/src/sets.rsdiffbeforeafterboth
1use std::cmp::Ordering;1use std::cmp::Ordering;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 function::builtin, operator::evaluate_compare_op, val::ArrValue, Result, Thunk, Val,4 Result, Thunk, Val, function::builtin, operator::evaluate_compare_op, val::ArrValue,
5};5};
6use jrsonnet_ir::BinaryOpType;6use jrsonnet_ir::BinaryOpType;
77
modifiedcrates/jrsonnet-stdlib/src/sort.rsdiffbeforeafterboth
3use std::cmp::Ordering;3use std::cmp::Ordering;
44
5use jrsonnet_evaluator::{5use jrsonnet_evaluator::{
6 bail,6 Result, Thunk, Val, bail,
7 function::builtin,7 function::builtin,
8 operator::evaluate_compare_op,8 operator::evaluate_compare_op,
9 val::{equals, ArrValue},9 val::{ArrValue, equals},
10 Result, Thunk, Val,
11};10};
12use jrsonnet_ir::BinaryOpType;11use jrsonnet_ir::BinaryOpType;
1312
modifiedcrates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth
1use std::collections::BTreeSet;1use std::collections::BTreeSet;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail,4 Either, IStr, Val, bail,
5 error::{ErrorKind::*, Result},5 error::{ErrorKind::*, Result},
6 function::builtin,6 function::builtin,
7 typed::{Either2, FromUntyped, M1},7 typed::{Either2, FromUntyped, M1},
8 val::{ArrValue, IndexableVal},8 val::{ArrValue, IndexableVal},
9 Either, IStr, Val,
10};9};
1110
12#[builtin]11#[builtin]
206#[cfg(feature = "exp-bigint")]205#[cfg(feature = "exp-bigint")]
207#[builtin]206#[builtin]
208pub fn builtin_bigint(v: Either![f64, IStr]) -> Result<Val> {207pub fn builtin_bigint(v: Either![f64, IStr]) -> Result<Val> {
209 use jrsonnet_evaluator::runtime_error;208 use Either2::*;
210 use Either2::*;209 use jrsonnet_evaluator::runtime_error;
211 Ok(match v {210 Ok(match v {
212 A(a) => {211 A(a) => {
213 Val::BigInt(Box::new(a.to_string().parse().map_err(|e| {212 Val::BigInt(Box::new(a.to_string().parse().map_err(|e| {
modifiedcrates/jrsonnet-stdlib/src/types.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{function::builtin, IStr, Val};1use jrsonnet_evaluator::{IStr, Val, function::builtin};
22
3#[builtin]3#[builtin]
4pub fn builtin_type(x: Val) -> IStr {4pub fn builtin_type(x: Val) -> IStr {
modifiedflake.lockdiffbeforeafterboth
2 "nodes": {2 "nodes": {
3 "crane": {3 "crane": {
4 "locked": {4 "locked": {
5 "lastModified": 1770419512,5 "lastModified": 1775245625,
6 "owner": "ipetkov",6 "owner": "CertainLach",
7 "repo": "crane",7 "repo": "crane",
8 "rev": "2510f2cbc3ccd237f700bb213756a8f35c32d8d7",8 "rev": "9c67a3098774323d0270004eed7d7291ddcfe918",
9 "type": "github"9 "type": "github"
10 },10 },
11 "original": {11 "original": {
12 "owner": "ipetkov",12 "owner": "CertainLach",
13 "ref": "refactor/drop-remarshal",
13 "repo": "crane",14 "repo": "crane",
14 "type": "github"15 "type": "github"
15 }16 }
16 },17 },
18 "fenix": {
19 "inputs": {
20 "nixpkgs": [
21 "nixpkgs"
22 ],
23 "rust-analyzer-src": "rust-analyzer-src"
24 },
25 "locked": {
26 "lastModified": 1775272531,
27 "owner": "CertainLach",
28 "repo": "fenix",
29 "rev": "831116e5887552af53f2998dcb46e1d55dc0850e",
30 "type": "github"
31 },
32 "original": {
33 "owner": "CertainLach",
34 "ref": "fix/libatomic",
35 "repo": "fenix",
36 "type": "github"
37 }
38 },
17 "flake-parts": {39 "flake-parts": {
18 "inputs": {40 "inputs": {
19 "nixpkgs-lib": [41 "nixpkgs-lib": [
20 "nixpkgs"42 "nixpkgs"
21 ]43 ]
22 },44 },
23 "locked": {45 "locked": {
24 "lastModified": 1769996383,46 "lastModified": 1775087534,
25 "owner": "hercules-ci",47 "owner": "hercules-ci",
26 "repo": "flake-parts",48 "repo": "flake-parts",
27 "rev": "57928607ea566b5db3ad13af0e57e921e6b12381",49 "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
28 "type": "github"50 "type": "github"
29 },51 },
30 "original": {52 "original": {
33 "type": "github"55 "type": "github"
34 }56 }
35 },57 },
58 "hercules-ci-effects": {
59 "inputs": {
60 "flake-parts": [
61 "flake-parts"
62 ],
63 "nixpkgs": [
64 "nixpkgs"
65 ]
66 },
67 "locked": {
68 "lastModified": 1773550609,
69 "owner": "hercules-ci",
70 "repo": "hercules-ci-effects",
71 "rev": "554f6ed448ca74c00aa2371cde901ae1e73005b9",
72 "type": "github"
73 },
74 "original": {
75 "owner": "hercules-ci",
76 "repo": "hercules-ci-effects",
77 "type": "github"
78 }
79 },
36 "nixpkgs": {80 "nixpkgs": {
37 "locked": {81 "locked": {
38 "lastModified": 1770468184,82 "lastModified": 1775270577,
39 "owner": "nixos",83 "owner": "nixos",
40 "repo": "nixpkgs",84 "repo": "nixpkgs",
41 "rev": "a124a10ea33a73329c42d67f30efcdbfb60a4e04",85 "rev": "9370b0614498381a0019e082c10e9cf8413e7c2c",
42 "type": "github"86 "type": "github"
43 },87 },
44 "original": {88 "original": {
51 "root": {95 "root": {
52 "inputs": {96 "inputs": {
53 "crane": "crane",97 "crane": "crane",
98 "fenix": "fenix",
54 "flake-parts": "flake-parts",99 "flake-parts": "flake-parts",
100 "hercules-ci-effects": "hercules-ci-effects",
55 "nixpkgs": "nixpkgs",101 "nixpkgs": "nixpkgs",
56 "rust-overlay": "rust-overlay",102 "shelly": "shelly",
57 "shelly": "shelly"103 "treefmt-nix": "treefmt-nix"
58 }104 }
59 },105 },
60 "rust-overlay": {106 "rust-analyzer-src": {
61 "inputs": {
62 "nixpkgs": [107 "flake": false,
63 "nixpkgs"
64 ]
65 },
66 "locked": {108 "locked": {
67 "lastModified": 1770433312,109 "lastModified": 1775174431,
110 "narHash": "sha256-jSw1C5MuyySiCpPgjdR+H0wPR3AgPRuylLunw+yd7A0=",
68 "owner": "oxalica",111 "owner": "rust-lang",
69 "repo": "rust-overlay",112 "repo": "rust-analyzer",
70 "rev": "9922ff9f99a6436756cbe6f5d11f9c3630e58cf0",113 "rev": "9767050b2db436f5a770c5f91a548c88fd91ec71",
71 "type": "github"114 "type": "github"
72 },115 },
73 "original": {116 "original": {
74 "owner": "oxalica",117 "owner": "rust-lang",
118 "ref": "nightly",
75 "repo": "rust-overlay",119 "repo": "rust-analyzer",
76 "type": "github"120 "type": "github"
77 }121 }
78 },122 },
89 "repo": "shelly",133 "repo": "shelly",
90 "type": "github"134 "type": "github"
91 }135 }
92 }136 },
137 "treefmt-nix": {
138 "inputs": {
139 "nixpkgs": [
140 "nixpkgs"
141 ]
142 },
143 "locked": {
144 "lastModified": 1775125835,
145 "owner": "numtide",
146 "repo": "treefmt-nix",
147 "rev": "75925962939880974e3ab417879daffcba36c4a3",
148 "type": "github"
149 },
150 "original": {
151 "owner": "numtide",
152 "repo": "treefmt-nix",
153 "type": "github"
154 }
155 }
93 },156 },
94 "root": "root",157 "root": "root",
95 "version": 7158 "version": 7
modifiedflake.nixdiffbeforeafterboth
2 description = "Jrsonnet";2 description = "Jrsonnet";
3 inputs = {3 inputs = {
4 nixpkgs.url = "github:nixos/nixpkgs/release-25.11";4 nixpkgs.url = "github:nixos/nixpkgs/release-25.11";
5 rust-overlay = {5 fenix = {
6 url = "github:oxalica/rust-overlay";6 url = "github:CertainLach/fenix/fix/libatomic";
7 inputs.nixpkgs.follows = "nixpkgs";7 inputs.nixpkgs.follows = "nixpkgs";
8 };8 };
9 flake-parts = {9 flake-parts = {
10 url = "github:hercules-ci/flake-parts";10 url = "github:hercules-ci/flake-parts";
11 inputs.nixpkgs-lib.follows = "nixpkgs";11 inputs.nixpkgs-lib.follows = "nixpkgs";
12 };12 };
13 hercules-ci-effects = {
14 url = "github:hercules-ci/hercules-ci-effects";
15 inputs.flake-parts.follows = "flake-parts";
16 inputs.nixpkgs.follows = "nixpkgs";
17 };
18 treefmt-nix = {
19 url = "github:numtide/treefmt-nix";
20 inputs.nixpkgs.follows = "nixpkgs";
21 };
13 crane.url = "github:ipetkov/crane";22 crane.url = "github:CertainLach/crane/refactor/drop-remarshal";
14 shelly.url = "github:CertainLach/shelly";23 shelly.url = "github:CertainLach/shelly";
15 };24 };
16 outputs =25 outputs =
17 inputs@{26 inputs:
18 nixpkgs,27 let
19 flake-parts,28 inherit (inputs.nixpkgs.lib)
20 rust-overlay,29 mkIf
21 crane,30 mkForce
22 shelly,31 optionals
23 ...32 optionalAttrs
24 }:33 ;
34 in
25 flake-parts.lib.mkFlake { inherit inputs; } {35 inputs.flake-parts.lib.mkFlake { inherit inputs; } {
26 imports = [ shelly.flakeModule ];36 imports = [
37 inputs.shelly.flakeModule
38 inputs.hercules-ci-effects.flakeModule
39 ];
27 systems = inputs.nixpkgs.lib.systems.flakeExposed;40 systems = [
41 "x86_64-linux"
42 "i686-linux"
43 "aarch64-linux"
44 "armv7l-linux"
45 "aarch64-darwin"
46 ];
28 perSystem =47 perSystem =
29 {48 {
30 config,49 config,
50 self',
31 system,51 system,
32 ...52 ...
33 }:53 }:
34 let54 let
35 pkgs = import nixpkgs {55 pkgs = import inputs.nixpkgs {
36 inherit system;56 inherit system;
37 overlays = [ rust-overlay.overlays.default ];57 overlays = [ inputs.fenix.overlays.default ];
38 config.allowUnsupportedSystem = true;58 config.allowUnsupportedSystem = true;
59 config.allowUnfreePredicate = pkg: pkg.name == "Xcode.app";
39 };60 };
61 targetArch = pkgs.stdenv.hostPlatform.parsed.cpu.name;
62 rustfmt = (pkgs.fenix.complete or pkgs.fenix.stable).rustfmt;
40 rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;63 toolchain = pkgs.fenix.combine [
64 (pkgs.fenix.stable.withComponents [
65 "cargo"
66 "clippy"
67 "rustc"
68 "rust-src"
69 ])
70 rustfmt
71 ];
41 craneLib = (crane.mkLib pkgs).overrideToolchain rust;72 craneLib = (inputs.crane.mkLib pkgs).overrideToolchain toolchain;
73 treefmt =
74 (inputs.treefmt-nix.lib.evalModule pkgs (import ./treefmt.nix { inherit rustfmt; })).config.build;
75
76 # Cross-compilation toolchains
77 crossToolchain = pkgs.fenix.combine [
78 (pkgs.fenix.stable.withComponents [
79 "cargo"
80 "rustc"
81 ])
82 pkgs.fenix.targets."${targetArch}-unknown-linux-musl".stable.rust-std
83 pkgs.fenix.targets."${targetArch}-apple-darwin".stable.rust-std
84 ];
85 craneLibCross = (inputs.crane.mkLib pkgs).overrideToolchain crossToolchain;
86
87 # Windows cross-compilation
88 pkgsWindows = import inputs.nixpkgs {
89 overlays = [ inputs.fenix.overlays.default ];
90 localSystem = system;
91 crossSystem = {
92 config = "${targetArch}-w64-mingw32";
93 libc = "msvcrt";
94 };
95 };
96 windowsToolchain = pkgs.fenix.combine [
97 (pkgs.fenix.stable.withComponents [
98 "cargo"
99 "rustc"
100 ])
101 pkgs.fenix.targets."${targetArch}-pc-windows-gnu".stable.rust-std
102 ];
103 craneLibWindows = (inputs.crane.mkLib pkgsWindows).overrideToolchain (_: windowsToolchain);
104
42 in105 in
43 {106 {
44 legacyPackages = {107 legacyPackages = {
45 jsonnetImpls = {108 release = optionalAttrs pkgs.stdenv.hostPlatform.isLinux (
46 go-jsonnet = pkgs.callPackage ./nix/go-jsonnet.nix { };109 {
47 sjsonnet = pkgs.callPackage ./nix/sjsonnet.nix { };
48 cpp-jsonnet = pkgs.callPackage ./nix/cpp-jsonnet.nix { };
49 # I didn't managed to build it, and nixpkgs version is marked as broken
50 # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };
51 rsjsonnet = pkgs.callPackage ./nix/rsjsonnet.nix { };
52 };
53 };
54 packages = rec {110 jrsonnet-linux-glibc = self'.packages.jrsonnet;
111 jrsonnet-experimental-linux-glibc = self'.packages.jrsonnet-experimental;
112 }
113 // optionalAttrs pkgs.stdenv.hostPlatform.is64bit rec {
114 jrsonnet-linux-musl = pkgs.callPackage ./nix/jrsonnet-cross-musl.nix {
115 craneLib = craneLibCross;
116 targetTriple = "${targetArch}-unknown-linux-musl";
117 muslCC = pkgs.pkgsMusl.stdenv.cc;
118 };
119 jrsonnet-experimental-linux-musl = jrsonnet-linux-musl.override {
120 withExperimentalFeatures = true;
121 };
122 }
123 // optionalAttrs (targetArch == "aarch64") rec {
124 jrsonnet-darwin = pkgs.callPackage ./nix/jrsonnet-cross-darwin.nix {
125 craneLib = craneLibCross;
126 targetTriple = "${targetArch}-apple-darwin";
127 };
128 jrsonnet-experimental-darwin = jrsonnet-darwin.override {
129 withExperimentalFeatures = true;
130 };
131 }
132 // optionalAttrs (targetArch == "x86_64") rec {
133 jrsonnet-windows = pkgsWindows.callPackage ./nix/jrsonnet-cross-windows.nix {
134 craneLib = craneLibWindows;
135 targetTriple = "${targetArch}-pc-windows-gnu";
136 };
137 jrsonnet-experimental-windows = jrsonnet-windows.override {
138 withExperimentalFeatures = true;
139 };
140 }
141 );
142 benchmarks = optionalAttrs (system == "x86_64-linux" || system == "aarch64-linux") {
55 default = jrsonnet;143 default = pkgs.callPackage ./nix/benchmarks.nix {
56
57 jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {
58 inherit craneLib;144 inherit (config.legacyPackages.jsonnetImpls)
145 go-jsonnet
146 sjsonnet
147 cpp-jsonnet
148 rsjsonnet
149 ;
150 jrsonnetVariants = [
151 {
152 drv = self'.packages.jrsonnet.override { forBenchmarks = true; };
153 name = "";
154 }
155 ];
59 };156 };
60 jrsonnet-experimental = pkgs.callPackage ./nix/jrsonnet.nix {
61 inherit craneLib;
62 withExperimentalFeatures = true;
63 };
64
65 jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {157 quick = pkgs.callPackage ./nix/benchmarks.nix {
158 inherit (config.legacyPackages.jsonnetImpls)
159 go-jsonnet
160 sjsonnet
161 cpp-jsonnet
162 rsjsonnet
163 ;
66 rustPlatform = pkgs.makeRustPlatform {164 quick = true;
165 jrsonnetVariants = [
166 {
67 rustc = rust;167 drv = self'.packages.jrsonnet.override { forBenchmarks = true; };
68 cargo = rust;168 name = "";
69 };169 }
170 ];
70 };171 };
71
72 benchmarks = pkgs.callPackage ./nix/benchmarks.nix {172 against-release = pkgs.callPackage ./nix/benchmarks.nix {
73 inherit (config.legacyPackages.jsonnetImpls)173 inherit (config.legacyPackages.jsonnetImpls)
74 go-jsonnet174 go-jsonnet
75 sjsonnet175 sjsonnet
78 ;178 ;
79 jrsonnetVariants = [179 jrsonnetVariants = [
80 {180 {
81 drv = jrsonnet.override { forBenchmarks = true; };181 drv = self'.packages.jrsonnet.override { forBenchmarks = true; };
82 name = "";182 name = "current";
83 }183 }
184 {
185 drv = self'.packages.jrsonnet-experimental.override { forBenchmarks = true; };
186 name = "current-experimental";
187 }
188 {
189 drv = self'.legacyPackages.jsonnetImpls.jrsonnet-release.override { forBenchmarks = true; };
190 name = "release";
191 }
84 ];192 ];
85 };193 };
86 benchmarks-quick = pkgs.callPackage ./nix/benchmarks.nix {
87 inherit (config.legacyPackages.jsonnetImpls)
88 go-jsonnet
89 sjsonnet
90 cpp-jsonnet
91 rsjsonnet
92 ;
93 quick = true;
94 jrsonnetVariants = [
95 {
96 drv = jrsonnet.override { forBenchmarks = true; };
97 name = "";
98 }
99 ];
100 };
101 benchmarks-against-release = pkgs.callPackage ./nix/benchmarks.nix {
102 inherit (config.legacyPackages.jsonnetImpls)
103 go-jsonnet
104 sjsonnet
105 cpp-jsonnet
106 rsjsonnet
107 ;
108 jrsonnetVariants = [
109 {
110 drv = jrsonnet.override { forBenchmarks = true; };
111 name = "current";
112 }
113 {
114 drv = jrsonnet-experimental.override { forBenchmarks = true; };
115 name = "current-experimental";
116 }
117 {
118 drv = jrsonnet-release.override { forBenchmarks = true; };
119 name = "release";
120 }
121 ];
122 };
123 benchmarks-quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {194 quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {
124 inherit (config.legacyPackages.jsonnetImpls)195 inherit (config.legacyPackages.jsonnetImpls)
125 go-jsonnet196 go-jsonnet
126 sjsonnet197 sjsonnet
130 quick = true;201 quick = true;
131 jrsonnetVariants = [202 jrsonnetVariants = [
132 {203 {
133 drv = jrsonnet.override { forBenchmarks = true; };204 drv = self'.packages.jrsonnet.override { forBenchmarks = true; };
134 name = "current";205 name = "current";
135 }206 }
136 {207 {
137 drv = jrsonnet-experimental.override { forBenchmarks = true; };208 drv = self'.packages.jrsonnet-experimental.override { forBenchmarks = true; };
138 name = "current-experimental";209 name = "current-experimental";
139 }210 }
140 {211 {
141 drv = jrsonnet-release.override { forBenchmarks = true; };212 drv = self'.legacyPackages.jsonnetImpls.jrsonnet-release.override { forBenchmarks = true; };
142 name = "release";213 name = "release";
143 }214 }
144 ];215 ];
145 };216 };
146 };217 };
218 jsonnetImpls = {
219 go-jsonnet = pkgs.callPackage ./nix/go-jsonnet.nix { };
220 sjsonnet = pkgs.callPackage ./nix/sjsonnet.nix { };
221 cpp-jsonnet = pkgs.callPackage ./nix/cpp-jsonnet.nix { };
222 # I didn't managed to build it, and nixpkgs version is marked as broken
223 # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };
224 rsjsonnet = pkgs.callPackage ./nix/rsjsonnet.nix { };
225 # Older released version of jrsonnet itself, for benchmarking purposes
226 jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {
227 rustPlatform = pkgs.makeRustPlatform {
228 rustc = toolchain;
229 cargo = toolchain;
230 };
231 };
232 };
233 };
234 packages =
235 let
236 jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {
237 inherit craneLib;
238 };
239 jrsonnet-experimental = pkgs.callPackage ./nix/jrsonnet.nix {
240 inherit craneLib;
241 withExperimentalFeatures = true;
242 };
243 in
244 {
245 default = jrsonnet;
246 inherit jrsonnet jrsonnet-experimental;
247 };
248 checks = optionalAttrs (system != "armv7l-linux") {
249 formatting = treefmt.check inputs.self;
250 };
251 formatter = mkIf (system != "armv7l-linux") treefmt.wrapper;
147 shelly.shells.default = {252 shelly.shells.default = {
148 factory = craneLib.devShell;253 factory = craneLib.devShell;
149 packages =254 packages =
158 hyperfine263 hyperfine
159 graphviz264 graphviz
160 ]265 ]
161 ++ lib.optionals (!stdenv.isDarwin) [266 ++ optionals (!stdenv.isDarwin) [
162 valgrind267 valgrind
163 kdePackages.kcachegrind268 kdePackages.kcachegrind
164 ];269 ];
165 };270 };
166 };271 };
272 hercules-ci.github-releases.files =
273 let
274 rel = system: inputs.self.legacyPackages.${system}.release;
275 bin = drv: "${drv}/bin/jrsonnet";
276 exe = drv: "${drv}/bin/jrsonnet.exe";
277 in
278 [
279 {
280 label = "jrsonnet-x86_64-linux-musl";
281 path = bin (rel "x86_64-linux").jrsonnet-linux-musl;
282 }
283 {
284 label = "jrsonnet-experimental-x86_64-linux-musl";
285 path = bin (rel "x86_64-linux").jrsonnet-experimental-linux-musl;
286 }
287 {
288 label = "jrsonnet-aarch64-darwin";
289 path = bin (rel "aarch64-linux").jrsonnet-darwin;
290 }
291 {
292 label = "jrsonnet-experimental-aarch64-darwin";
293 path = bin (rel "aarch64-linux").jrsonnet-experimental-darwin;
294 }
295 {
296 label = "jrsonnet-x86_64-windows.exe";
297 path = exe (rel "x86_64-linux").jrsonnet-windows;
298 }
299 {
300 label = "jrsonnet-experimental-x86_64-windows.exe";
301 path = exe (rel "x86_64-linux").jrsonnet-experimental-windows;
302 }
303
304 {
305 label = "jrsonnet-aarch64-linux-musl";
306 path = bin (rel "aarch64-linux").jrsonnet-linux-musl;
307 }
308 {
309 label = "jrsonnet-experimental-aarch64-linux-musl";
310 path = bin (rel "aarch64-linux").jrsonnet-experimental-linux-musl;
311 }
312
313 {
314 label = "jrsonnet-x86_64-linux-glibc";
315 path = bin (rel "x86_64-linux").jrsonnet-linux-glibc;
316 }
317 {
318 label = "jrsonnet-experimental-x86_64-linux-glibc";
319 path = bin (rel "x86_64-linux").jrsonnet-experimental-linux-glibc;
320 }
321 {
322 label = "jrsonnet-aarch64-linux-glibc";
323 path = bin (rel "aarch64-linux").jrsonnet-linux-glibc;
324 }
325 {
326 label = "jrsonnet-experimental-aarch64-linux-glibc";
327 path = bin (rel "aarch64-linux").jrsonnet-experimental-linux-glibc;
328 }
329 {
330 label = "jrsonnet-i686-linux-glibc";
331 path = bin (rel "i686-linux").jrsonnet-linux-glibc;
332 }
333 {
334 label = "jrsonnet-experimental-i686-linux-glibc";
335 path = bin (rel "i686-linux").jrsonnet-experimental-linux-glibc;
336 }
337 {
338 label = "jrsonnet-armv7l-linux-glibc";
339 path = bin (rel "armv7l-linux").jrsonnet-linux-glibc;
340 }
341 {
342 label = "jrsonnet-experimental-armv7l-linux-glibc";
343 path = bin (rel "armv7l-linux").jrsonnet-experimental-linux-glibc;
344 }
345 ];
346 hercules-ci.cargo-publish = {
347 enable = true;
348 secretName = "crates-io";
349 };
350 hercules-ci.flake-update = {
351 enable = true;
352 baseMerge.enable = true;
353 baseMerge.method = "fast-forward";
354 when = {
355 dayOfWeek = [ "Sat" ];
356 };
357 };
358 herculesCI =
359 { lib, config, ... }:
360 {
361 ciSystems = [
362 "x86_64-linux"
363 "i686-linux"
364 "aarch64-linux"
365 "armv7l-linux"
366 # TODO: add workers for these platforms
367 # "aarch64-darwin"
368 ];
369 onPush.default.outputs = {
370 benchmarks.x86_64-linux = inputs.self.legacyPackages.x86_64-linux.benchmarks.default;
371
372 # Cross: musl/mingw/darwin-zigbuild
373 release.x86_64-linux = inputs.self.legacyPackages.x86_64-linux.release;
374 release.aarch64-linux = inputs.self.legacyPackages.aarch64-linux.release;
375 release.armv7l-linux = inputs.self.legacyPackages.armv7l-linux.release;
376 release.i686-linux = inputs.self.legacyPackages.i686-linux.release;
377
378 # Too much to build for CI purposes
379 devShells = mkForce { };
380 formatter = mkForce { };
381
382 # No need to run them on different arch, pretty large derivations and might try to compile GHC
383 checks.i686-linux.formatting = mkForce { };
384 checks.aarch64-linux.formatting = mkForce { };
385 };
386 };
167 };387 };
168}388}
169389
modifiednix/benchmarks.nixdiffbeforeafterboth
53in53in
54stdenv.mkDerivation {54stdenv.mkDerivation {
55 name = "benchmarks";55 name = "benchmarks";
56 __impure = true;56 # __impure = true; # not supported by hercules-ci
57 unpackPhase = "true";57 unpackPhase = "true";
5858
59 buildInputs = [59 buildInputs = [
79 skipGo ? "",79 skipGo ? "",
80 vendor ? "",80 vendor ? "",
81 }:81 }:
82 ''82 ''
83 echo >> $out83 echo >> $out
84 echo "=== ${name}" >> $out84 echo "=== ${name}" >> $out
85 echo >> $out85 echo >> $out
86 ${optionalString (skipRustAlternative != "") ''86 ${optionalString (skipRustAlternative != "") ''
87 echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out87 echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out
88 echo >> $out88 echo >> $out
89 ''}89 ''}
90 ${optionalString (skipGo != "") ''90 ${optionalString (skipGo != "") ''
91 echo "> Note: No results for Go, ${skipGo}" >> $out91 echo "> Note: No results for Go, ${skipGo}" >> $out
92 echo >> $out92 echo >> $out
93 ''}93 ''}
94 ${optionalString (skipScala != "") ''94 ${optionalString (skipScala != "") ''
95 echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out95 echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out
96 echo >> $out96 echo >> $out
97 ''}97 ''}
98 ${optionalString (skipCpp != "") ''98 ${optionalString (skipCpp != "") ''
99 echo "> Note: No results for C++, ${skipCpp}" >> $out99 echo "> Note: No results for C++, ${skipCpp}" >> $out
100 echo >> $out100 echo >> $out
101 ''}101 ''}
102 ${optionalString (!quick && !omitSource) ''102 ${optionalString (!quick && !omitSource) ''
103 echo ".Source" >> $out103 echo ".Source" >> $out
104 echo "[%collapsible]" >> $out104 echo "[%collapsible]" >> $out
105 echo "====" >> $out105 echo "====" >> $out
106 echo "[source,jsonnet]" >> $out106 echo "[source,jsonnet]" >> $out
107 echo "----" >> $out107 echo "----" >> $out
108 ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}108 ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}
109 cat ${path} >> $out109 cat ${path} >> $out
110 echo >> $out110 echo >> $out
111 echo "----" >> $out111 echo "----" >> $out
112 echo "====" >> $out112 echo "====" >> $out
113 echo >> $out113 echo >> $out
114 ''}114 ''}
115 path=${path}115 path=${path}
116 ${optionalString pathIsGenerator ''116 ${optionalString pathIsGenerator ''
117 go-jsonnet $path > generated.jsonnet117 go-jsonnet $path > generated.jsonnet
118 path=generated.jsonnet118 path=generated.jsonnet
119 ''}119 ''}
120 hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \120 hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \
121 ${121 ${
122 concatStringsSep " " (122 concatStringsSep " " (
123 forEach jrsonnetVariants (123 forEach jrsonnetVariants (
124 variant:124 variant:
125 "\"${variant.drv}/bin/jrsonnet $path${optionalString (vendor != "") " -J${vendor}"}\" -n \"Rust${125 "\"${variant.drv}/bin/jrsonnet $path${optionalString (vendor != "") " -J${vendor}"}\" -n \"Rust${
126 if variant.name != "" then " (${variant.name})" else ""126 if variant.name != "" then " (${variant.name})" else ""
127 }\""127 }\""
128 )128 )
129 )129 )
130 } \130 } \
131 ${131 ${
132 optionalString (skipRustAlternative == "")132 optionalString (skipRustAlternative == "")
133 "\"rsjsonnet $path${133 "\"rsjsonnet $path${
134 optionalString (vendor != "") " -J ${vendor}"134 optionalString (vendor != "") " -J ${vendor}"
135 }\" -n \"Rust (alternative, rsjsonnet)\""135 }\" -n \"Rust (alternative, rsjsonnet)\""
136 } \136 } \
137 ${137 ${
138 optionalString (skipGo == "")138 optionalString (skipGo == "")
139 "\"go-jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Go\""139 "\"go-jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Go\""
140 } \140 } \
141 ${141 ${
142 optionalString (skipScala == "")142 optionalString (skipScala == "")
143 "\"sjsonnet-native $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (native)\""143 "\"sjsonnet-native $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (native)\""
144 } \144 } \
145 ${145 ${
146 optionalString (skipScala == "")146 # My aarch64-linux machine can't run graalvm image:
147 # The current machine does not support all of the following CPU features that are required by the image: [FP, ASIMD, CRC32, LSE].
148 optionalString (skipScala == "" && stdenv.hostPlatform.system != "aarch64-linux")
147 "\"sjsonnet-graalvm $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (GraalVM)\""149 "\"sjsonnet-graalvm $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (GraalVM)\""
148 } \150 } \
149 ${optionalString (skipCpp == "")151 ${optionalString (skipCpp == "")
150 "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""152 "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""
151 }153 }
152 cat result.adoc >> $out154 cat result.adoc >> $out
153 '';155 '';
154 in156 in
155 ''157 ''
156 set -oux158 set -oux
157 ulimit -s unlimited159 ulimit -s unlimited
158160
159 temp=$(mktemp -d)161 temp=$(mktemp -d)
160 cd $temp162 cd $temp
161163
162 touch $out164 touch $out
163 ${optionalString (!quick) ''165 ${optionalString (!quick) ''
164 cat ${./benchmarks.adoc} >> $out166 cat ${./benchmarks.adoc} >> $out
165 echo >> $out167 echo >> $out
166168
167 echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out169 echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out
168 echo >> $out170 echo >> $out
169171
170 echo ".Tested versions" >> $out172 echo ".Tested versions" >> $out
171 echo "[%collapsible]" >> $out173 echo "[%collapsible]" >> $out
172 echo "====" >> $out174 echo "====" >> $out
173 echo "* Go: $(go-jsonnet --version)" >> $out175 echo "* Go: $(go-jsonnet --version)" >> $out
174 echo "* C++: $(jsonnet --version)" >> $out176 echo "* C++: $(jsonnet --version)" >> $out
175 echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out177 echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out
176 echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out178 echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out
177 ${concatStringsSep "\n" (forEach jrsonnetVariants (variant:179 ${concatStringsSep "\n" (
180 forEach jrsonnetVariants (
181 variant:
178 "echo \"* Rust${if variant.name != "" then " (${variant.name})" else ""}: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"182 "echo \"* Rust${
183 if variant.name != "" then " (${variant.name})" else ""
184 }: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"
179 ))}185 )
186 )}
180 echo "====" >> $out187 echo "====" >> $out
181 echo >> $out188 echo >> $out
182 ''}189 ''}
183 echo "== Real world" >> $out190 echo "== Real world" >> $out
184 ${mkBench {191 ${mkBench {
185 name = "Graalvm CI";192 name = "Graalvm CI";
186 path = "${graalvmBench}/ci.jsonnet";193 path = "${graalvmBench}/ci.jsonnet";
187 omitSource = true;194 omitSource = true;
188 skipCpp = "takes longer than a hour";195 skipCpp = "takes longer than a hour";
189 skipGo = skipSlow;196 skipGo = skipSlow;
190 skipScala = skipSlow;197 skipScala = skipSlow;
191 }}198 }}
192 ${mkBench {199 ${mkBench {
193 name = "Kube-prometheus manifests";200 name = "Kube-prometheus manifests";
194 vendor = "${kubePrometheusBench}/vendor";201 vendor = "${kubePrometheusBench}/vendor";
195 path = "${kubePrometheusBench}/example.jsonnet";202 path = "${kubePrometheusBench}/example.jsonnet";
196 omitSource = true;203 omitSource = true;
197 skipCpp = "too slow, takes hours, skews results";204 skipCpp = "too slow, takes hours, skews results";
198 skipGo = skipSlow;205 skipGo = skipSlow;
199 skipScala = skipSlow;206 skipScala = skipSlow;
200 }}207 }}
201208
202 echo >> $out209 echo >> $out
203 echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out210 echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out
204 ${mkBench {211 ${mkBench {
205 name = "Large string join";212 name = "Large string join";
206 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";213 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";
207 skipScala = skipSlow;214 skipScala = skipSlow;
208 }}215 }}
209 ${mkBench {216 ${mkBench {
210 name = "Large string template";217 name = "Large string template";
211 omitSource = true;218 omitSource = true;
212 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";219 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";
213 skipGo = "fails with os stack size exhausion";220 skipGo = "fails with os stack size exhausion";
214 skipCpp = "too slow, takes hours, skews results";221 skipCpp = "too slow, takes hours, skews results";
215 skipScala = skipSlow;222 skipScala = skipSlow;
216 }}223 }}
217 ${mkBench {224 ${mkBench {
218 name = "Realistic 1";225 name = "Realistic 1";
219 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";226 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";
220 skipGo = skipSlow;227 skipGo = skipSlow;
221 skipCpp = "too slow, takes hours, skews results";228 skipCpp = "too slow, takes hours, skews results";
222 skipScala = skipSlow;229 skipScala = skipSlow;
223 }}230 }}
224 ${mkBench {231 ${mkBench {
225 name = "Realistic 2";232 name = "Realistic 2";
226 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";233 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";
227 skipGo = skipSlow;234 skipGo = skipSlow;
228 skipCpp = "too slow, takes hours, skews results";235 skipCpp = "too slow, takes hours, skews results";
229 skipScala = skipSlow;236 skipScala = skipSlow;
230 }}237 }}
231238
232 echo >> $out239 echo >> $out
233 echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out240 echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out
234 ${mkBench {241 ${mkBench {
235 name = "Tail call";242 name = "Tail call";
236 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";243 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";
237 skipScala = skipSlow;244 skipScala = skipSlow;
238 }}245 }}
239 ${mkBench {246 ${mkBench {
240 name = "Inheritance recursion";247 name = "Inheritance recursion";
241 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";248 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";
242 skipCpp = skipSlow;249 skipCpp = skipSlow;
243 skipGo = skipSlow;250 skipGo = skipSlow;
244 }}251 }}
245 ${mkBench {252 ${mkBench {
246 name = "Simple recursive call";253 name = "Simple recursive call";
247 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";254 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";
248 skipScala = skipSlow;255 skipScala = skipSlow;
249 skipGo = skipSlow;256 skipGo = skipSlow;
250 }}257 }}
251 ${mkBench {258 ${mkBench {
252 name = "Foldl string concat";259 name = "Foldl string concat";
253 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";260 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";
254 skipCpp = skipSlow;261 skipCpp = skipSlow;
255 skipScala = skipSlow;262 skipScala = skipSlow;
256 }}263 }}
257 ${mkBench {264 ${mkBench {
258 name = "Array sorts";265 name = "Array sorts";
259 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";266 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";
260 skipCpp = skipSlow;267 skipCpp = skipSlow;
261 }}268 }}
262 ${mkBench {269 ${mkBench {
263 name = "Lazy array";270 name = "Lazy array";
264 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";271 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";
265 skipGo = skipSlow;272 skipGo = skipSlow;
266 }}273 }}
267 ${mkBench {274 ${mkBench {
268 name = "Inheritance function recursion";275 name = "Inheritance function recursion";
269 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";276 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";
270 skipCpp = skipSlow;277 skipCpp = skipSlow;
271 skipScala = skipSlow;278 skipScala = skipSlow;
272 }}279 }}
273 ${mkBench {280 ${mkBench {
274 name = "String strips";281 name = "String strips";
275 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";282 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";
276 skipCpp = "too slow, takes hours, skews results";283 skipCpp = "too slow, takes hours, skews results";
277 skipScala = skipSlow;284 skipScala = skipSlow;
278 }}285 }}
279 ${mkBench {286 ${mkBench {
280 name = "Big object";287 name = "Big object";
281 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";288 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";
282 pathIsGenerator = true;289 pathIsGenerator = true;
283 skipScala = skipSlow;290 skipScala = skipSlow;
284 }}291 }}
285292
286 echo >> $out293 echo >> $out
287 echo "== Benchmarks from Go jsonnet (builtins)" >> $out294 echo "== Benchmarks from Go jsonnet (builtins)" >> $out
288 ${mkBench {295 ${mkBench {
289 name = "std.base64";296 name = "std.base64";
290 path = "${goJsonnetBench}/base64.jsonnet";297 path = "${goJsonnetBench}/base64.jsonnet";
291 skipRustAlternative = skipSlow;298 skipRustAlternative = skipSlow;
292 skipCpp = "too slow, takes hours, skews results";299 skipCpp = "too slow, takes hours, skews results";
293 skipScala = skipSlow;300 skipScala = skipSlow;
294 }}301 }}
295 ${mkBench {302 ${mkBench {
296 name = "std.base64Decode";303 name = "std.base64Decode";
297 path = "${goJsonnetBench}/base64Decode.jsonnet";304 path = "${goJsonnetBench}/base64Decode.jsonnet";
298 skipRustAlternative = skipSlow;305 skipRustAlternative = skipSlow;
299 skipCpp = skipSlow;306 skipCpp = skipSlow;
300 skipScala = skipSlow;307 skipScala = skipSlow;
301 }}308 }}
302 ${mkBench {309 ${mkBench {
303 name = "std.base64DecodeBytes";310 name = "std.base64DecodeBytes";
304 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";311 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";
305 skipRustAlternative = skipSlow;312 skipRustAlternative = skipSlow;
306 skipCpp = skipSlow;313 skipCpp = skipSlow;
307 skipGo = skipSlow;314 skipGo = skipSlow;
308 skipScala = skipSlow;315 skipScala = skipSlow;
309 }}316 }}
310 ${mkBench {317 ${mkBench {
311 name = "std.base64 (byte array)";318 name = "std.base64 (byte array)";
312 path = "${goJsonnetBench}/base64_byte_array.jsonnet";319 path = "${goJsonnetBench}/base64_byte_array.jsonnet";
313 skipRustAlternative = skipSlow;320 skipRustAlternative = skipSlow;
314 skipCpp = skipSlow;321 skipCpp = skipSlow;
315 skipGo = skipSlow;322 skipGo = skipSlow;
316 skipScala = skipSlow;323 skipScala = skipSlow;
317 }}324 }}
318 ${mkBench {325 ${mkBench {
319 name = "std.foldl";326 name = "std.foldl";
320 path = "${goJsonnetBench}/foldl.jsonnet";327 path = "${goJsonnetBench}/foldl.jsonnet";
321 skipScala = skipSlow;328 skipScala = skipSlow;
322 }}329 }}
323 ${mkBench {330 ${mkBench {
324 name = "std.manifestJsonEx";331 name = "std.manifestJsonEx";
325 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";332 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";
326 skipScala = skipSlow;333 skipScala = skipSlow;
327 skipCpp = skipSlow;334 skipCpp = skipSlow;
328 }}335 }}
329 ${mkBench {336 ${mkBench {
330 name = "std.manifestTomlEx";337 name = "std.manifestTomlEx";
331 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";338 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";
332 skipCpp = skipSlow;339 skipCpp = skipSlow;
333 }}340 }}
334 ${mkBench {341 ${mkBench {
335 name = "std.parseInt";342 name = "std.parseInt";
336 path = "${goJsonnetBench}/parseInt.jsonnet";343 path = "${goJsonnetBench}/parseInt.jsonnet";
337 skipScala = skipSlow;344 skipScala = skipSlow;
338 skipCpp = skipSlow;345 skipCpp = skipSlow;
339 }}346 }}
340 ${mkBench {347 ${mkBench {
341 name = "std.reverse";348 name = "std.reverse";
342 path = "${goJsonnetBench}/reverse.jsonnet";349 path = "${goJsonnetBench}/reverse.jsonnet";
343 skipCpp = skipSlow;350 skipCpp = skipSlow;
344 skipGo = skipSlow;351 skipGo = skipSlow;
345 }}352 }}
346 ${mkBench {353 ${mkBench {
347 name = "std.substr";354 name = "std.substr";
348 path = "${goJsonnetBench}/substr.jsonnet";355 path = "${goJsonnetBench}/substr.jsonnet";
349 skipScala = skipSlow;356 skipScala = skipSlow;
350 }}357 }}
351 ${mkBench {358 ${mkBench {
352 name = "Comparsion for array";359 name = "Comparsion for array";
353 path = "${goJsonnetBench}/comparison.jsonnet";360 path = "${goJsonnetBench}/comparison.jsonnet";
354 skipCpp = "too slow, takes hours, skews results";361 skipCpp = "too slow, takes hours, skews results";
355 }}362 }}
356 ${mkBench {363 ${mkBench {
357 name = "Comparsion for primitives";364 name = "Comparsion for primitives";
358 path = "${goJsonnetBench}/comparison2.jsonnet";365 path = "${goJsonnetBench}/comparison2.jsonnet";
359 skipRustAlternative = skipSlow;366 skipRustAlternative = skipSlow;
360 skipCpp = "can't run: uses up to 192GB of RAM";367 skipCpp = "can't run: uses up to 192GB of RAM";
361 skipGo = skipSlow;368 skipGo = skipSlow;
362 skipScala = skipSlow;369 skipScala = skipSlow;
363 }}370 }}
364 '';371 '';
365}372}
366373
addednix/jrsonnet-cross-darwin.nixdiffbeforeafterboth

no changes

addednix/jrsonnet-cross-musl.nixdiffbeforeafterboth

no changes

addednix/jrsonnet-cross-windows.nixdiffbeforeafterboth

no changes

modifiednix/jrsonnet-release.nixdiffbeforeafterboth

no syntactic changes

modifiednix/jrsonnet.nixdiffbeforeafterboth
5 withExperimentalFeatures ? false,5 withExperimentalFeatures ? false,
6 forBenchmarks ? false,6 forBenchmarks ? false,
7}:7}:
8let
8with lib;9 inherit (lib) optionalString;
10in
9 craneLib.buildPackage {11craneLib.buildPackage {
10 src = lib.cleanSourceWith {12 src = lib.cleanSourceWith {
11 src = ../.;13 src = ../.;
21 nativeBuildInputs = [makeWrapper];21 nativeBuildInputs = [ makeWrapper ];
2222
23 # To clean-up hyperfine output23 # To clean-up hyperfine output
24 postInstall = optionalString forBenchmarks ''24 postInstall = optionalString forBenchmarks ''
25 wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000"25 wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000"
26 '';26 '';
27 }27}
2828
modifiednix/rsjsonnet.nixdiffbeforeafterboth

no syntactic changes

modifiednix/sjsonnet.nixdiffbeforeafterboth

no syntactic changes

modifiedrust-toolchain.tomldiffbeforeafterboth
1[toolchain]1[toolchain]
2channel = "1.93.0"2channel = "stable"
3components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]3components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
44
addedtreefmt.nixdiffbeforeafterboth

no changes

modifiedxtask/Cargo.tomldiffbeforeafterboth

no syntactic changes

modifiedxtask/src/main.rsdiffbeforeafterboth
1use anyhow::Result;1use anyhow::Result;
2use clap::Parser;2use clap::Parser;
3use xshell::{cmd, Shell};3use xshell::{Shell, cmd};
44
5mod sourcegen;5mod sourcegen;
66
modifiedxtask/src/sourcegen/ast.rsdiffbeforeafterboth
5use ungrammar::{Grammar, Rule};5use ungrammar::{Grammar, Rule};
66
7use super::{7use super::{
8 KindsSrc,
8 util::{pluralize, to_lower_snake_case},9 util::{pluralize, to_lower_snake_case},
9 KindsSrc,
10};10};
1111
12impl AstNodeSrc {12impl AstNodeSrc {
282 _ => return false,282 _ => return false,
283 };283 };
284 let (node, repeat, trailing_comma) = match rule.as_slice() {284 let (node, repeat, trailing_comma) = match rule.as_slice() {
285 [Rule::Node(node), Rule::Rep(repeat), Rule::Opt(trailing_comma)] => {285 [
286 Rule::Node(node),
287 Rule::Rep(repeat),
288 Rule::Opt(trailing_comma),
286 (node, repeat, trailing_comma)289 ] => (node, repeat, trailing_comma),
287 }
288 _ => return false,290 _ => return false,
289 };291 };
290 let repeat = match &**repeat {292 let repeat = match &**repeat {
modifiedxtask/src/sourcegen/mod.rsdiffbeforeafterboth
1use std::{collections::HashMap, path::PathBuf};1use std::{collections::HashMap, path::PathBuf};
22
3use anyhow::Result;3use anyhow::Result;
4use ast::{lower, AstSrc};4use ast::{AstSrc, lower};
5use itertools::Itertools;5use itertools::Itertools;
6use kinds::{KindsSrc, TokenKind};6use kinds::{KindsSrc, TokenKind};
7use proc_macro2::{Ident, Punct, Spacing, Span, TokenStream};7use proc_macro2::{Ident, Punct, Spacing, Span, TokenStream};
modifiedxtask/src/sourcegen/util.rsdiffbeforeafterboth
3use std::{fs, path::Path};3use std::{fs, path::Path};
44
5use anyhow::Result;5use anyhow::Result;
6use xshell::{cmd, Shell};6use xshell::{Shell, cmd};
77
8/// Checks that the `file` has the specified `contents`. If that is not the8/// Checks that the `file` has the specified `contents`. If that is not the
9/// case, updates the file and then fails the test.9/// case, updates the file and then fails the test.