difftreelog
build use `workspace.dependencies`
in: master
16 files changed
Cargo.lockdiffbeforeafterboth81 packageslockfile v3
Might be heavy and slow!
ahash
0.7.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47used byannotate-snippets
0.9.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36depends onused byanyhow
1.0.57crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdcused byatty
0.2.14crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8depends onused byautocfg
1.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97faused bybase64
0.13.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fdused bybincode
1.3.3crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcaddepends onbitflags
1.3.2crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718aused bycc
1.0.73crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11used bycfg-if
0.1.10crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822used bycfg-if
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbaf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fdused byclap
3.2.8crates.io↘ 9↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83depends onclap_complete
3.2.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumead064480dfc4880a10764488415a97fdd36a4cf1bb022d372f02e8faf8386e1depends onused byclap_derive
3.2.7crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902used byclap_lex
0.2.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5depends onused bycloudabi
0.0.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4fdepends onused bygetrandom
0.2.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205adused byhashbrown
0.11.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726eused byhashbrown
0.12.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdb0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3depends onheck
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9used byhermit-abi
0.1.19crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33depends onused byindexmap
1.8.2crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5adepends onitoa
1.0.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578dused byjrsonnet
0.4.2workspace↘ 8↖ 0jrsonnet-cli
0.4.2workspace↘ 5↖ 1jrsonnet-evaluator
0.4.2workspace↘ 15↖ 5depends onjrsonnet-gcmodule
0.3.4crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum22d4e1572e4b61e4f5deb3701312a330df0e69b48805a540d740e5e53ac8c78ajrsonnet-gcmodule-derive
0.3.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumae2f3bf7d38e0a9098b5b9062a7d9e7a97a206bc3c91118d76e7e37f2e0f1202depends onused byjrsonnet-interner
0.4.2workspace↘ 5↖ 2jrsonnet-macros
0.4.2workspace↘ 3↖ 2jrsonnet-parser
0.4.2workspace↘ 6↖ 5jrsonnet-types
0.4.2workspace↘ 2↖ 1depends onused bylibc
0.2.126crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836libjsonnet
0.4.2workspace↘ 4↖ 0linked-hash-map
0.5.6crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770fused bylock_api
0.3.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75depends onused bymd5
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771used bymimalloc-sys
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4aa3cefb626f6ae3d0b2f71c5378c89d2b1d4d7bc246b0ca9a7ee61a4daad291depends onused bymimallocator
0.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d44fe4ebf6b538fcf39d9975c2b90bb3232d1ba8e8bffeacd004f27b20c577adepends onused byonce_cell
1.12.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225used byos_str_bytes
6.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afaused byparking_lot
0.10.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505edepends onused byparking_lot_core
0.7.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3used bypathdiff
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44ddused bypeg
0.8.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaf728fe826811af3b38c37e93de6d104485953ea373d656eebae53d6987fcd2cdepends onpeg-macros
0.8.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4536be147b770b824895cbad934fccce8e49f14b4c4946eaa46a6e4a12fcdc16used bypeg-runtime
0.8.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf9b0efd3ba03c3a409d44d60425f279ec442bcf0b9e63ff4e410da31c8b0f69fused byproc-macro-error
1.0.4crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumda25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38cused byproc-macro-error-attr
1.0.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869used byproc-macro2
1.0.39crates.io↘ 1↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56fdepends onquote
1.0.18crates.io↘ 1↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1depends onredox_syscall
0.1.57crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ceused byrustc-hash
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2ryu
1.0.10crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695scopeguard
1.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cdused byserde
1.0.142crates.io↘ 1↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume590c437916fb6b221e1d00df6e3294f3fccd70ca7e92541c475d6ed6ef5fee2depends onserde_derive
1.0.142crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum34b5b8d809babe02f538c2cfec6f2c1ed10804c0e5a6a041a049a4f5588ccc2edepends onused byserde_json
1.0.82crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7depends onused byserde_yaml_with_quirks
0.8.24crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47c5983eba86eae2d0058c35fb1065ccffb23af7f8965871069269088098321aused bysmallvec
1.8.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83used bystatic_assertions
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543fstrsim
0.10.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623structdump
0.2.0crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb0570327507bf281d8a6e6b0d4c082b12cb6bcee27efce755aa5efacd44076c1structdump-derive
0.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum29cc0b59cfa11f1bceda09a9a7e37e6a6c3138575fd24ade8aa9af6d09aedf28depends onused bysyn
1.0.96crates.io↘ 3↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebftermcolor
1.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755depends onused bytests
0.1.0workspace↘ 4↖ 0thiserror
1.0.31crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069adepends onthiserror-impl
1.0.31crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79adepends onused byunicode-ident
1.0.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493eeused byunicode-width
0.1.9crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973used byversion_check
0.9.4crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483fwasi
0.10.2+wasi-snapshot-preview1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6used bywinapi
0.3.9crates.io↘ 2↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419winapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-util
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178depends onused bywinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused byyaml-rust
0.4.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85depends onused byyansi-term
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1depends onused by
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,16 @@
[workspace]
+package.version = "0.5.0"
members = ["crates/*", "bindings/jsonnet", "cmds/jrsonnet", "tests"]
+[workspace.dependencies]
+jrsonnet-evaluator = { path = "./crates/jrsonnet-evaluator", version = "0.5.0" }
+jrsonnet-macros = { path = "./crates/jrsonnet-macros", version = "0.5.0" }
+jrsonnet-parser = { path = "./crates/jrsonnet-parser", version = "0.5.0" }
+jrsonnet-interner = { path = "./crates/jrsonnet-interner", version = "0.5.0" }
+jrsonnet-stdlib = { path = "./crates/jrsonnet-stdlib", version = "0.5.0" }
+jrsonnet-cli = { path = "./crates/jrsonnet-cli", version = "0.5.0" }
+jrsonnet-types = { path = "./crates/jrsonnet-types", version = "0.5.0" }
+
[profile.test]
opt-level = 1
bindings/jsonnet/Cargo.tomldiffbeforeafterboth--- a/bindings/jsonnet/Cargo.toml
+++ b/bindings/jsonnet/Cargo.toml
@@ -1,16 +1,16 @@
[package]
name = "libjsonnet"
description = "Rust implementation of libjsonnet.so"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
publish = false
[dependencies]
-jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }
-jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
-jrsonnet-stdlib = { path = "../../crates/jrsonnet-stdlib", version = "0.4.2" }
+jrsonnet-evaluator.workspace = true
+jrsonnet-parser.workspace = true
+jrsonnet-stdlib.workspace = true
jrsonnet-gcmodule = { version = "0.3.4" }
[lib]
cmds/jrsonnet/Cargo.tomldiffbeforeafterboth--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet"
description = "Rust jsonnet implementation"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
@@ -21,9 +21,9 @@
legacy-this-file = ["jrsonnet-cli/legacy-this-file"]
[dependencies]
-jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }
-jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
-jrsonnet-cli = { path = "../../crates/jrsonnet-cli", version = "0.4.2" }
+jrsonnet-evaluator.workspace = true
+jrsonnet-parser.workspace = true
+jrsonnet-cli.workspace = true
jrsonnet-gcmodule = { version = "0.3.4" }
mimallocator = { version = "0.1.3", optional = true }
crates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-cli/Cargo.toml
+++ b/crates/jrsonnet-cli/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-cli"
description = "Utilities for building jrsonnet CLIs"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
@@ -14,11 +14,9 @@
legacy-this-file = ["jrsonnet-stdlib/legacy-this-file"]
[dependencies]
-jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2", features = [
- "explaining-traces",
-] }
-jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
+jrsonnet-evaluator = { workspace = true, features = ["explaining-traces"] }
+jrsonnet-parser.workspace = true
+jrsonnet-stdlib.workspace = true
jrsonnet-gcmodule = { version = "0.3.4" }
-jrsonnet-stdlib = { path = "../../crates/jrsonnet-stdlib", version = "0.4.2" }
clap = { version = "4.0", features = ["derive"] }
crates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-evaluator/Cargo.toml
+++ b/crates/jrsonnet-evaluator/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-evaluator"
description = "jsonnet interpreter"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
@@ -24,10 +24,10 @@
nightly = []
[dependencies]
-jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }
-jrsonnet-parser = { path = "../jrsonnet-parser", version = "0.4.2" }
-jrsonnet-types = { path = "../jrsonnet-types", version = "0.4.2" }
-jrsonnet-macros = { path = "../jrsonnet-macros", version = "0.4.2" }
+jrsonnet-interner.workspace = true
+jrsonnet-parser.workspace = true
+jrsonnet-types.workspace = true
+jrsonnet-macros.workspace = true
jrsonnet-gcmodule = { version = "0.3.4" }
pathdiff = "0.2.1"
crates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
@@ -32,7 +32,7 @@
Destruct::Array { start, rest, end } => {
use jrsonnet_parser::DestructRest;
- use crate::{throw, val::ArrValue};
+ use crate::val::ArrValue;
#[derive(Trace)]
struct DataThunk {
@@ -43,8 +43,8 @@
impl ThunkValue for DataThunk {
type Output = ArrValue;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let v = self.parent.evaluate(s)?;
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let v = self.parent.evaluate()?;
let arr = match v {
Val::Arr(a) => a,
_ => throw!("expected array"),
@@ -79,9 +79,9 @@
impl ThunkValue for BaseThunk {
type Output = Val;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let full = self.full.evaluate(s.clone())?;
- Ok(full.get(s, self.index)?.expect("length is checked"))
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let full = self.full.evaluate()?;
+ Ok(full.get(self.index)?.expect("length is checked"))
}
}
for (i, d) in start.iter().enumerate() {
@@ -108,8 +108,8 @@
impl ThunkValue for RestThunk {
type Output = Val;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let full = self.full.evaluate(s)?;
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let full = self.full.evaluate()?;
let to = full.len() - self.end;
Ok(Val::Arr(full.slice(Some(self.start), Some(to), None)))
}
@@ -140,10 +140,10 @@
impl ThunkValue for EndThunk {
type Output = Val;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let full = self.full.evaluate(s.clone())?;
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let full = self.full.evaluate()?;
Ok(full
- .get(s, full.len() - self.end + self.index)?
+ .get(full.len() - self.end + self.index)?
.expect("length is checked"))
}
}
@@ -163,7 +163,7 @@
}
#[cfg(feature = "exp-destruct")]
Destruct::Object { fields, rest } => {
- use crate::{obj::ObjValue, throw};
+ use crate::obj::ObjValue;
#[derive(Trace)]
struct DataThunk {
@@ -174,8 +174,8 @@
impl ThunkValue for DataThunk {
type Output = ObjValue;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let v = self.parent.evaluate(s)?;
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let v = self.parent.evaluate()?;
let obj = match v {
Val::Obj(o) => o,
_ => throw!("expected object"),
@@ -215,13 +215,13 @@
impl ThunkValue for FieldThunk {
type Output = Val;
- fn get(self: Box<Self>, s: State) -> Result<Self::Output> {
- let full = self.full.evaluate(s.clone())?;
- if let Some(field) = full.get(s.clone(), self.field)? {
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ let full = self.full.evaluate()?;
+ if let Some(field) = full.get(self.field)? {
Ok(field)
} else {
let (fctx, expr) = self.default.as_ref().expect("shape is checked");
- Ok(evaluate(s, fctx.clone().unwrap(), &expr)?)
+ Ok(evaluate(fctx.clone().unwrap(), &expr)?)
}
}
}
crates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/integrations/serde.rs
+++ b/crates/jrsonnet-evaluator/src/integrations/serde.rs
@@ -178,7 +178,10 @@
}
Val::Obj(obj) => {
let mut map = serializer.serialize_map(Some(obj.len()))?;
- for (field, value) in obj.iter() {
+ for (field, value) in obj.iter(
+ #[cfg(feature = "exp-preserve-order")]
+ true,
+ ) {
let mut serde_error = None;
// TODO: rewrite using try{} after stabilization
State::push_description(
crates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -368,8 +368,14 @@
.map_or(false, |v| v.is_visible())
}
- pub fn iter(&self) -> impl Iterator<Item = (IStr, Result<Val>)> + '_ {
- let fields = self.fields();
+ pub fn iter(
+ &self,
+ #[cfg(feature = "exp-preserve-order")] preserve_order: bool,
+ ) -> impl Iterator<Item = (IStr, Result<Val>)> + '_ {
+ let fields = self.fields(
+ #[cfg(feature = "exp-preserve-order")]
+ preserve_order,
+ );
fields.into_iter().map(|field| {
(
field.clone(),
crates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/stdlib/format.rs
+++ b/crates/jrsonnet-evaluator/src/stdlib/format.rs
@@ -625,6 +625,7 @@
pub fn format_arr(str: &str, mut values: &[Val]) -> Result<String> {
let codes = parse_codes(str)?;
let mut out = String::new();
+ let value_count = values.len();
for code in codes {
match code {
@@ -673,6 +674,13 @@
}
}
+ if !values.is_empty() {
+ throw!(
+ "too many values to format, expected {value_count}, got {}",
+ value_count + values.len()
+ )
+ }
+
Ok(out)
}
crates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-interner/Cargo.toml
+++ b/crates/jrsonnet-interner/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-interner"
description = "Jrsonnet string interning"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
crates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-interner/src/lib.rs
+++ b/crates/jrsonnet-interner/src/lib.rs
@@ -255,9 +255,7 @@
let mut pool = pool.borrow_mut();
let entry = pool.raw_entry_mut().from_key(bytes);
match entry {
- hashbrown::hash_map::RawEntryMut::Occupied(mut i) => {
- IBytes(i.get_key_value().0.clone())
- }
+ hashbrown::hash_map::RawEntryMut::Occupied(i) => IBytes(i.get_key_value().0.clone()),
hashbrown::hash_map::RawEntryMut::Vacant(e) => {
let (k, _) = e.insert(Inner::new_bytes(bytes), ());
IBytes(k.clone())
crates/jrsonnet-macros/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-macros/Cargo.toml
+++ b/crates/jrsonnet-macros/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jrsonnet-macros"
-version = "0.4.2"
+version.workspace = true
edition = "2021"
[lib]
crates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-parser/Cargo.toml
+++ b/crates/jrsonnet-parser/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-parser"
description = "jsonnet language parser and AST"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
@@ -26,7 +26,7 @@
serde = ["dep:serde"]
[dependencies]
-jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }
+jrsonnet-interner.workspace = true
jrsonnet-gcmodule = { version = "0.3.4" }
static_assertions = "1.1"
crates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-stdlib"
description = "jsonnet standard library packaged as crate"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"
@@ -17,9 +17,9 @@
exp-preserve-order = ["jrsonnet-evaluator/exp-preserve-order"]
[dependencies]
-jrsonnet-evaluator = { path = "../jrsonnet-evaluator", version = "0.4.2" }
-jrsonnet-macros = { path = "../jrsonnet-macros", version = "0.4.2" }
-jrsonnet-parser = { path = "../jrsonnet-parser", version = "0.4.2" }
+jrsonnet-evaluator.workspace = true
+jrsonnet-macros.workspace = true
+jrsonnet-parser.workspace = true
jrsonnet-gcmodule = "0.3.4"
# Used for stdlib AST serialization
@@ -37,5 +37,5 @@
serde_yaml_with_quirks = "0.8.24"
[build-dependencies]
-jrsonnet-parser = { path = "../jrsonnet-parser", version = "0.4.2" }
+jrsonnet-parser.workspace = true
structdump = { version = "0.2.0", features = ["derive"] }
crates/jrsonnet-types/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-types/Cargo.toml
+++ b/crates/jrsonnet-types/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "jrsonnet-types"
description = "Jrsonnet type system definition"
-version = "0.4.2"
+version.workspace = true
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2021"