difftreelog
Merge branch 'fix/tests'
in: master
10 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,9 +19,9 @@
[[package]]
name = "ahash"
-version = "0.8.6"
+version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
+checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f"
dependencies = [
"cfg-if",
"once_cell",
@@ -46,19 +46,19 @@
[[package]]
name = "annotate-snippets"
-version = "0.9.2"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
+checksum = "0a433302f833baa830c0092100c481c7ea768c5981a3c36f549517a502f246dd"
dependencies = [
+ "anstyle",
"unicode-width",
- "yansi-term",
]
[[package]]
name = "anstream"
-version = "0.6.5"
+version = "0.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6"
+checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540"
dependencies = [
"anstyle",
"anstyle-parse",
@@ -70,9 +70,9 @@
[[package]]
name = "anstyle"
-version = "1.0.4"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"
+checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
[[package]]
name = "anstyle-parse"
@@ -104,9 +104,9 @@
[[package]]
name = "anyhow"
-version = "1.0.75"
+version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
+checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
[[package]]
name = "ass-stroke"
@@ -152,9 +152,9 @@
[[package]]
name = "base64"
-version = "0.21.5"
+version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
+checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "beef"
@@ -179,9 +179,9 @@
[[package]]
name = "bitflags"
-version = "2.4.1"
+version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
+checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
[[package]]
name = "block-buffer"
@@ -194,9 +194,9 @@
[[package]]
name = "bumpalo"
-version = "3.14.0"
+version = "3.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
+checksum = "c764d619ca78fccbf3069b37bd7af92577f044bb15236036662d79b6559f25b7"
[[package]]
name = "cc"
@@ -215,9 +215,9 @@
[[package]]
name = "clap"
-version = "4.4.11"
+version = "4.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2"
+checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da"
dependencies = [
"clap_builder",
"clap_derive",
@@ -225,9 +225,9 @@
[[package]]
name = "clap_builder"
-version = "4.4.11"
+version = "4.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb"
+checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb"
dependencies = [
"anstream",
"anstyle",
@@ -237,30 +237,30 @@
[[package]]
name = "clap_complete"
-version = "4.4.4"
+version = "4.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
+checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c"
dependencies = [
"clap",
]
[[package]]
name = "clap_derive"
-version = "4.4.7"
+version = "4.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
+checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47"
dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
name = "clap_lex"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
+checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"
[[package]]
name = "colorchoice"
@@ -270,14 +270,14 @@
[[package]]
name = "console"
-version = "0.15.7"
+version = "0.15.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8"
+checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb"
dependencies = [
"encode_unicode",
"lazy_static",
"libc",
- "windows-sys 0.45.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -288,31 +288,27 @@
[[package]]
name = "cpufeatures"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
+checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
dependencies = [
"libc",
]
[[package]]
name = "crossbeam-channel"
-version = "0.5.8"
+version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
+checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b"
dependencies = [
- "cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
-version = "0.8.16"
+version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
-dependencies = [
- "cfg-if",
-]
+checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
[[package]]
name = "crypto-common"
@@ -347,13 +343,13 @@
[[package]]
name = "dprint-core"
-version = "0.63.3"
+version = "0.65.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7227b28d24aafee21ff72512336c797fa00bb3ea803186b1b105a68abc97660b"
+checksum = "b569f4e3085ae957ecc37588e6b2227791b72745434eae966db29e122ba27f0d"
dependencies = [
"anyhow",
"bumpalo",
- "indexmap 2.1.0",
+ "indexmap 2.2.3",
"rustc-hash",
"serde",
"unicode-width",
@@ -367,9 +363,9 @@
[[package]]
name = "either"
-version = "1.9.0"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
+checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
[[package]]
name = "encode_unicode"
@@ -437,9 +433,9 @@
[[package]]
name = "getrandom"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
+checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
"cfg-if",
"libc",
@@ -460,15 +456,6 @@
[[package]]
name = "hashbrown"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
-dependencies = [
- "ahash",
-]
-
-[[package]]
-name = "hashbrown"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
@@ -484,12 +471,6 @@
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
-name = "hermit-abi"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
-
-[[package]]
name = "idna"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -511,9 +492,9 @@
[[package]]
name = "indexmap"
-version = "2.1.0"
+version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
+checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177"
dependencies = [
"equivalent",
"hashbrown 0.14.3",
@@ -528,9 +509,9 @@
[[package]]
name = "insta"
-version = "1.34.0"
+version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc"
+checksum = "7c985c1bef99cf13c58fade470483d81a2bfe846ebde60ed28cc2dddec2df9e2"
dependencies = [
"console",
"lazy_static",
@@ -540,27 +521,16 @@
]
[[package]]
-name = "is-terminal"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
-dependencies = [
- "hermit-abi",
- "rustix",
- "windows-sys 0.48.0",
-]
-
-[[package]]
name = "is_ci"
-version = "1.1.1"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
+checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45"
[[package]]
name = "itertools"
-version = "0.11.0"
+version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
+checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
dependencies = [
"either",
]
@@ -687,7 +657,7 @@
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
@@ -751,9 +721,9 @@
[[package]]
name = "keccak"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
+checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"
dependencies = [
"cpufeatures",
]
@@ -766,9 +736,9 @@
[[package]]
name = "libc"
-version = "0.2.151"
+version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libjsonnet"
@@ -788,9 +758,9 @@
[[package]]
name = "linux-raw-sys"
-version = "0.4.12"
+version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
+checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
[[package]]
name = "lock_api"
@@ -810,41 +780,51 @@
[[package]]
name = "logos"
-version = "0.12.1"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf8b031682c67a8e3d5446840f9573eb7fe26efe7ec8d195c9ac4c0647c502f1"
+checksum = "161971eb88a0da7ae0c333e1063467c5b5727e7fb6b710b8db4814eade3a42e8"
dependencies = [
"logos-derive",
]
[[package]]
-name = "logos-derive"
-version = "0.12.1"
+name = "logos-codegen"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d849148dbaf9661a6151d1ca82b13bb4c4c128146a88d05253b38d4e2f496c"
+checksum = "8e31badd9de5131fdf4921f6473d457e3dd85b11b7f091ceb50e4df7c3eeb12a"
dependencies = [
"beef",
"fnv",
+ "lazy_static",
"proc-macro2",
"quote",
- "regex-syntax 0.6.29",
- "syn 1.0.109",
+ "regex-syntax",
+ "syn 2.0.50",
+]
+
+[[package]]
+name = "logos-derive"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c2a69b3eb68d5bd595107c9ee58d7e07fe2bb5e360cc85b0f084dedac80de0a"
+dependencies = [
+ "logos-codegen",
]
[[package]]
name = "lru"
-version = "0.10.1"
+version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670"
+checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22"
dependencies = [
- "hashbrown 0.13.2",
+ "hashbrown 0.14.3",
]
[[package]]
name = "lsp-server"
-version = "0.7.5"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb69ba934913ebf0ef3b3dd762f0149bf993decd571d094b646de09c2e456732"
+checksum = "248f65b78f6db5d8e1b1604b4098a28b43d21a8eb1deeca22b1c421b276c7095"
dependencies = [
"crossbeam-channel",
"log",
@@ -854,9 +834,9 @@
[[package]]
name = "lsp-types"
-version = "0.94.1"
+version = "0.95.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1"
+checksum = "158c1911354ef73e8fe42da6b10c0484cb65c7f1007f28022e847706c1ab6984"
dependencies = [
"bitflags 1.3.2",
"serde",
@@ -873,9 +853,9 @@
[[package]]
name = "memchr"
-version = "2.6.4"
+version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "memoffset"
@@ -888,15 +868,13 @@
[[package]]
name = "miette"
-version = "5.10.0"
+version = "7.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e"
+checksum = "baed61d13cc3723ee6dbed730a82bfacedc60a85d81da2d77e9c3e8ebc0b504a"
dependencies = [
"backtrace",
"backtrace-ext",
- "is-terminal",
"miette-derive",
- "once_cell",
"owo-colors",
"supports-color",
"supports-hyperlinks",
@@ -909,13 +887,13 @@
[[package]]
name = "miette-derive"
-version = "5.10.0"
+version = "7.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
+checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
@@ -939,9 +917,9 @@
[[package]]
name = "miniz_oxide"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
+checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
dependencies = [
"adler",
]
@@ -960,28 +938,27 @@
[[package]]
name = "num-integer"
-version = "0.1.45"
+version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
- "autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
-version = "0.2.17"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
+checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
dependencies = [
"autocfg",
]
[[package]]
name = "object"
-version = "0.32.1"
+version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
+checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
@@ -994,9 +971,9 @@
[[package]]
name = "owo-colors"
-version = "3.5.0"
+version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
+checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f"
[[package]]
name = "parking_lot"
@@ -1068,18 +1045,18 @@
[[package]]
name = "proc-macro2"
-version = "1.0.70"
+version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
+checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.33"
+version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@@ -1144,7 +1121,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.11",
+ "getrandom 0.2.12",
]
[[package]]
@@ -1194,35 +1171,29 @@
[[package]]
name = "regex"
-version = "1.10.2"
+version = "1.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
+checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
- "regex-syntax 0.8.2",
+ "regex-syntax",
]
[[package]]
name = "regex-automata"
-version = "0.4.3"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
+checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"
dependencies = [
"aho-corasick",
"memchr",
- "regex-syntax 0.8.2",
+ "regex-syntax",
]
[[package]]
name = "regex-syntax"
-version = "0.6.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
-
-[[package]]
-name = "regex-syntax"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
@@ -1254,11 +1225,11 @@
[[package]]
name = "rustix"
-version = "0.38.28"
+version = "0.38.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316"
+checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
dependencies = [
- "bitflags 2.4.1",
+ "bitflags 2.4.2",
"errno",
"libc",
"linux-raw-sys",
@@ -1267,9 +1238,9 @@
[[package]]
name = "ryu"
-version = "1.0.16"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
+checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
[[package]]
name = "scopeguard"
@@ -1279,29 +1250,29 @@
[[package]]
name = "serde"
-version = "1.0.193"
+version = "1.0.197"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
+checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.193"
+version = "1.0.197"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
+checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
name = "serde_json"
-version = "1.0.108"
+version = "1.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
+checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
dependencies = [
"itoa",
"ryu",
@@ -1310,13 +1281,13 @@
[[package]]
name = "serde_repr"
-version = "0.1.17"
+version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145"
+checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
@@ -1365,15 +1336,15 @@
[[package]]
name = "similar"
-version = "2.3.0"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597"
+checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21"
[[package]]
name = "smallvec"
-version = "1.11.2"
+version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
+checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
[[package]]
name = "smawk"
@@ -1389,9 +1360,9 @@
[[package]]
name = "strsim"
-version = "0.10.0"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
[[package]]
name = "structdump"
@@ -1417,31 +1388,24 @@
[[package]]
name = "supports-color"
-version = "2.1.0"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89"
+checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f"
dependencies = [
- "is-terminal",
"is_ci",
]
[[package]]
name = "supports-hyperlinks"
-version = "2.1.0"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d"
-dependencies = [
- "is-terminal",
-]
+checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee"
[[package]]
name = "supports-unicode"
-version = "2.0.0"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7"
-dependencies = [
- "is-terminal",
-]
+checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2"
[[package]]
name = "syn"
@@ -1456,9 +1420,9 @@
[[package]]
name = "syn"
-version = "2.0.39"
+version = "2.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
+checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb"
dependencies = [
"proc-macro2",
"quote",
@@ -1467,25 +1431,24 @@
[[package]]
name = "tempfile"
-version = "3.8.1"
+version = "3.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
+checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67"
dependencies = [
"cfg-if",
"fastrand",
- "redox_syscall",
"rustix",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
name = "terminal_size"
-version = "0.1.17"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
+checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"
dependencies = [
- "libc",
- "winapi",
+ "rustix",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -1506,9 +1469,9 @@
[[package]]
name = "textwrap"
-version = "0.15.2"
+version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d"
+checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
dependencies = [
"smawk",
"unicode-linebreak",
@@ -1517,22 +1480,22 @@
[[package]]
name = "thiserror"
-version = "1.0.50"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.50"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
[[package]]
@@ -1564,9 +1527,9 @@
[[package]]
name = "unicode-bidi"
-version = "0.3.14"
+version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416"
+checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]]
name = "unicode-ident"
@@ -1582,9 +1545,9 @@
[[package]]
name = "unicode-normalization"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
+checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
dependencies = [
"tinyvec",
]
@@ -1630,37 +1593,6 @@
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "windows-sys"
-version = "0.45.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
-dependencies = [
- "windows-targets 0.42.2",
-]
[[package]]
name = "windows-sys"
@@ -1682,21 +1614,6 @@
[[package]]
name = "windows-targets"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
-]
-
-[[package]]
-name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
@@ -1724,12 +1641,6 @@
"windows_x86_64_gnullvm 0.52.0",
"windows_x86_64_msvc 0.52.0",
]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_gnullvm"
@@ -1745,12 +1656,6 @@
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
-
-[[package]]
-name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
@@ -1763,12 +1668,6 @@
[[package]]
name = "windows_i686_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
-
-[[package]]
-name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
@@ -1781,12 +1680,6 @@
[[package]]
name = "windows_i686_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
-
-[[package]]
-name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
@@ -1796,12 +1689,6 @@
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnu"
@@ -1817,12 +1704,6 @@
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
@@ -1832,12 +1713,6 @@
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
@@ -1871,7 +1746,7 @@
version = "0.1.0"
dependencies = [
"anyhow",
- "indexmap 2.1.0",
+ "indexmap 2.2.3",
"itertools",
"proc-macro2",
"quote",
@@ -1886,33 +1761,24 @@
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
-]
-
-[[package]]
-name = "yansi-term"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
-dependencies = [
- "winapi",
]
[[package]]
name = "zerocopy"
-version = "0.7.31"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.31"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.50",
]
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,54 +18,54 @@
jrsonnet-gcmodule = "0.3.6"
ass-stroke = { git = "https://github.com/CertainLach/ass-stroke", version = "0.1.0" }
-serde = "1.0.190"
-serde_json = "1.0.107"
+serde = "1.0.197"
+serde_json = "1.0.114"
serde_yaml_with_quirks = "0.8.24"
-anyhow = "1.0.48"
+anyhow = "1.0.80"
thiserror = "1.0"
mimallocator = "0.1.3"
indoc = "2.0"
-dprint-core = "0.63.2"
-insta = "1.15"
-tempfile = "3.8"
+dprint-core = "0.65.0"
+insta = "1.35"
+tempfile = "3.10"
pathdiff = "0.2.1"
-hashbrown = "0.14.2"
+hashbrown = "0.14.3"
static_assertions = "1.1"
rustc-hash = "1.1"
bincode = "1.3"
-annotate-snippets = "0.9.1"
-num-bigint = "0.4.3"
+annotate-snippets = "0.10.1"
+num-bigint = "0.4.4"
derivative = "2.2.0"
-strsim = "0.10.0"
+strsim = "0.11.0"
structdump = "0.2.0"
proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"
peg = "0.8.2"
drop_bomb = "0.1.5"
-logos = "0.12.0"
-miette = "5.5.0"
+logos = "0.14.0"
+miette = "7.1.0"
rowan = "0.15"
text-size = "1.1"
md5 = "0.7.0"
-sha1 = "0.10.5"
-sha2 = "0.10.6"
+sha1 = "0.10.6"
+sha2 = "0.10.8"
sha3 = "0.10.8"
-base64 = "0.21.0"
-indexmap = "2.0.2"
-itertools = "0.11.0"
+base64 = "0.21.7"
+indexmap = "2.2.3"
+itertools = "0.12.1"
ungrammar = "1.16.1"
-xshell = "0.2.2"
+xshell = "0.2.5"
-clap = "4.4"
-clap_complete = "4.4"
+clap = "4.5"
+clap_complete = "4.5"
-lsp-server = "0.7.4"
-lsp-types = "0.94.1"
+lsp-server = "0.7.6"
+lsp-types = "0.95.0"
-regex = "1.8.4"
-lru = "0.10.0"
+regex = "1.10.3"
+lru = "0.12.2"
#[profile.test]
#opt-level = 1
cmds/jrsonnet-fmt/src/children.rsdiffbeforeafterboth--- a/cmds/jrsonnet-fmt/src/children.rs
+++ b/cmds/jrsonnet-fmt/src/children.rs
@@ -60,41 +60,6 @@
out
}
-pub fn trivia_between(
- node: SyntaxNode,
- start: Option<&SyntaxElement>,
- end: Option<&SyntaxElement>,
-) -> EndingComments {
- let mut iter = node.children_with_tokens().peekable();
- while iter.peek() != start {
- iter.next();
- }
- iter.next();
-
- let loose = start.is_none() || end.is_none();
-
- let mut out = Vec::new();
- for item in iter.take_while(|i| Some(i) != end) {
- if let Some(trivia) = item.as_token().cloned().and_then(Trivia::cast) {
- out.push(Ok(trivia));
- } else if CustomError::can_cast(item.kind()) {
- out.push(Err(item.to_string()))
- } else if loose {
- break;
- } else {
- assert!(
- TS![, ;].contains(item.kind()),
- "silently eaten token: {:?}",
- item.kind()
- )
- }
- }
- EndingComments {
- should_start_with_newline: should_start_with_newline(None, &out),
- trivia: out,
- }
-}
-
pub fn children_between<T: AstNode + Debug>(
node: SyntaxNode,
start: Option<&SyntaxElement>,
cmds/jrsonnet-fmt/src/main.rsdiffbeforeafterboth--- a/cmds/jrsonnet-fmt/src/main.rs
+++ b/cmds/jrsonnet-fmt/src/main.rs
@@ -20,7 +20,7 @@
};
use crate::{
- children::{trivia_after, trivia_between},
+ children::trivia_after,
comments::{format_comments, CommentLocation},
};
cmds/jrsonnet-lsp/src/main.rsdiffbeforeafterboth--- a/cmds/jrsonnet-lsp/src/main.rs
+++ b/cmds/jrsonnet-lsp/src/main.rs
@@ -13,7 +13,7 @@
let mut log = File::create("test").unwrap();
writeln!(log, "start").unwrap();
let (connection, io_threads) = Connection::stdio();
- let capabilities = serde_json::to_value(&ServerCapabilities {
+ let capabilities = serde_json::to_value(ServerCapabilities {
completion_provider: Some(CompletionOptions::default()),
definition_provider: Some(lsp_types::OneOf::Left(true)),
document_link_provider: Some(DocumentLinkOptions {
crates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-evaluator/Cargo.toml
+++ b/crates/jrsonnet-evaluator/Cargo.toml
@@ -53,7 +53,7 @@
# Serialized stdlib
bincode = { workspace = true, optional = true }
# Explaining traces
-annotate-snippets = { workspace = true, features = ["color"], optional = true }
+annotate-snippets = { workspace = true, optional = true }
# Bigint
num-bigint = { workspace = true, features = ["serde"], optional = true }
derivative.workspace = true
crates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/trace/mod.rs
+++ b/crates/jrsonnet-evaluator/src/trace/mod.rs
@@ -314,8 +314,12 @@
desc: &str,
) -> Result<(), std::fmt::Error> {
use annotate_snippets::{
- display_list::{DisplayList, FormatOptions},
- snippet::{AnnotationType, Slice, Snippet, SourceAnnotation},
+ // DisplayList, FormatOptions,
+ AnnotationType,
+ Renderer,
+ Slice,
+ Snippet,
+ SourceAnnotation,
};
let source_fragment: String = source
@@ -329,10 +333,10 @@
|r| self.resolver.resolve(r),
);
let snippet = Snippet {
- opt: FormatOptions {
- color: true,
- ..FormatOptions::default()
- },
+ // opt: FormatOptions {
+ // color: true,
+ // ..FormatOptions::default()
+ // },
title: None,
footer: vec![],
slices: vec![Slice {
@@ -352,7 +356,8 @@
}],
};
- let dl = DisplayList::from(snippet);
+ let renderer = Renderer::styled();
+ let dl = renderer.render(snippet);
write!(out, "{dl}")?;
Ok(())
crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rsdiffbeforeafterboth--- a/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
+++ b/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
@@ -290,4 +290,5 @@
}
#[macro_export]
macro_rules ! T { [||] => { $ crate :: SyntaxKind :: OR } ; [??] => { $ crate :: SyntaxKind :: NULL_COAELSE } ; [&&] => { $ crate :: SyntaxKind :: AND } ; [|] => { $ crate :: SyntaxKind :: BIT_OR } ; [^] => { $ crate :: SyntaxKind :: BIT_XOR } ; [&] => { $ crate :: SyntaxKind :: BIT_AND } ; [==] => { $ crate :: SyntaxKind :: EQ } ; [!=] => { $ crate :: SyntaxKind :: NE } ; [<] => { $ crate :: SyntaxKind :: LT } ; [>] => { $ crate :: SyntaxKind :: GT } ; [<=] => { $ crate :: SyntaxKind :: LE } ; [>=] => { $ crate :: SyntaxKind :: GE } ; [<<] => { $ crate :: SyntaxKind :: LHS } ; [>>] => { $ crate :: SyntaxKind :: RHS } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [-] => { $ crate :: SyntaxKind :: MINUS } ; [*] => { $ crate :: SyntaxKind :: MUL } ; [/] => { $ crate :: SyntaxKind :: DIV } ; [%] => { $ crate :: SyntaxKind :: MODULO } ; [!] => { $ crate :: SyntaxKind :: NOT } ; [~] => { $ crate :: SyntaxKind :: BIT_NOT } ; ['['] => { $ crate :: SyntaxKind :: L_BRACK } ; [']'] => { $ crate :: SyntaxKind :: R_BRACK } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_BRACE } ; ['}'] => { $ crate :: SyntaxKind :: R_BRACE } ; [:] => { $ crate :: SyntaxKind :: COLON } ; [::] => { $ crate :: SyntaxKind :: COLONCOLON } ; [:::] => { $ crate :: SyntaxKind :: COLONCOLONCOLON } ; [;] => { $ crate :: SyntaxKind :: SEMI } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [...] => { $ crate :: SyntaxKind :: DOTDOTDOT } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; ['$'] => { $ crate :: SyntaxKind :: DOLLAR } ; [=] => { $ crate :: SyntaxKind :: ASSIGN } ; [?] => { $ crate :: SyntaxKind :: QUESTION_MARK } ; [tailstrict] => { $ crate :: SyntaxKind :: TAILSTRICT_KW } ; [local] => { $ crate :: SyntaxKind :: LOCAL_KW } ; [importstr] => { $ crate :: SyntaxKind :: IMPORTSTR_KW } ; [importbin] => { $ crate :: SyntaxKind :: IMPORTBIN_KW } ; [import] => { $ crate :: SyntaxKind :: IMPORT_KW } ; [if] => { $ crate :: SyntaxKind :: IF_KW } ; [then] => { $ crate :: SyntaxKind :: THEN_KW } ; [else] => { $ crate :: SyntaxKind :: ELSE_KW } ; [function] => { $ crate :: SyntaxKind :: FUNCTION_KW } ; [error] => { $ crate :: SyntaxKind :: ERROR_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [null] => { $ crate :: SyntaxKind :: NULL_KW } ; [true] => { $ crate :: SyntaxKind :: TRUE_KW } ; [false] => { $ crate :: SyntaxKind :: FALSE_KW } ; [self] => { $ crate :: SyntaxKind :: SELF_KW } ; [super] => { $ crate :: SyntaxKind :: SUPER_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [assert] => { $ crate :: SyntaxKind :: ASSERT_KW } }
+#[allow(unused_imports)]
pub use T;
xtask/src/sourcegen/ast.rsdiffbeforeafterboth--- a/xtask/src/sourcegen/ast.rs
+++ b/xtask/src/sourcegen/ast.rs
@@ -148,7 +148,7 @@
lower_rule(&mut fields, grammar, None, rule, false);
let mut types = HashMap::new();
for field in fields.iter().filter(|f| f.token_name().is_none()) {
- if let Some(old) = types.insert(field.ty(), field.method_name(kinds)) {
+ if let Some(_old) = types.insert(field.ty(), field.method_name(kinds)) {
// panic!("{name}.{} has same type as {name}.{}, resolve conflict by wrapping one field: {}", old, field.method_name(kinds), field.ty());
}
// TODO: check for assignable field types, i.e you can have
xtask/src/sourcegen/mod.rsdiffbeforeafterboth1use std::path::PathBuf;23use anyhow::Result;4use ast::{lower, AstSrc};5use itertools::Itertools;6use kinds::{KindsSrc, TokenKind};7use proc_macro2::{Punct, Spacing, TokenStream};8use quote::{format_ident, quote};9use ungrammar::Grammar;10use util::{ensure_file_contents, reformat, to_pascal_case, to_upper_snake_case};1112mod ast;13mod kinds;14mod util;1516enum SpecialName {17 Literal,18 Meta,19 Error,20}21fn classify_special(name: &str) -> Option<(SpecialName, &str)> {22 let name = name.strip_suffix('!')?;23 Some(if let Some(name) = name.strip_prefix("LIT_") {24 (SpecialName::Literal, name)25 } else if let Some(name) = name.strip_prefix("META_") {26 (SpecialName::Meta, name)27 } else if let Some(name) = name.strip_prefix("ERROR_") {28 (SpecialName::Error, name)29 } else {30 return None;31 })32}3334pub fn generate_ungrammar() -> Result<()> {35 let grammar: Grammar = include_str!(concat!(36 env!("CARGO_MANIFEST_DIR"),37 "/../crates/jrsonnet-rowan-parser/jsonnet.ungram"38 ))39 .parse()?;4041 let mut kinds = kinds::jsonnet_kinds();42 let ast = lower(&kinds, &grammar);4344 for token in grammar.tokens() {45 let token = &grammar[token];46 let token = &token.name.clone();47 if !kinds.is_token(token) {48 if let Some((special, name)) = classify_special(token) {49 match special {50 SpecialName::Literal => panic!("literal is not defined: {name}"),51 SpecialName::Meta => {52 eprintln!("implicit meta: {}", name);53 kinds.define_token(TokenKind::Meta {54 grammar_name: token.to_owned(),55 name: format!("META_{}", name),56 })57 }58 SpecialName::Error => {59 eprintln!("implicit error: {}", name);60 kinds.define_token(TokenKind::Error {61 grammar_name: token.to_owned(),62 name: format!("ERROR_{}", name),63 regex: None,64 priority: None,65 is_lexer_error: true,66 })67 }68 };69 continue;70 };71 let name = to_upper_snake_case(token);72 eprintln!("implicit kw: {}", token);73 kinds.define_token(TokenKind::Keyword {74 code: token.to_owned(),75 name: format!("{name}_KW"),76 });77 }78 }79 for node in &ast.nodes {80 let name = to_upper_snake_case(&node.name);81 kinds.define_node(&name);82 }83 for enum_ in &ast.enums {84 let name = to_upper_snake_case(&enum_.name);85 kinds.define_node(&name);86 }87 for token_enum in &ast.token_enums {88 let name = to_upper_snake_case(&token_enum.name);89 kinds.define_node(&name);90 }9192 let syntax_kinds = generate_syntax_kinds(&kinds, &ast)?;9394 let nodes = generate_nodes(&kinds, &ast)?;95 ensure_file_contents(96 &PathBuf::from(concat!(97 env!("CARGO_MANIFEST_DIR"),98 "/../crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs",99 )),100 &syntax_kinds,101 )?;102 ensure_file_contents(103 &PathBuf::from(concat!(104 env!("CARGO_MANIFEST_DIR"),105 "/../crates/jrsonnet-rowan-parser/src/generated/nodes.rs",106 )),107 &nodes,108 )?;109 Ok(())110}111112fn generate_syntax_kinds(kinds: &KindsSrc, grammar: &AstSrc) -> Result<String> {113 let t_macros = kinds.tokens().filter_map(TokenKind::expand_t_macros);114 let token_kinds = kinds.tokens().map(TokenKind::expand_kind);115116 let keywords = kinds117 .tokens()118 .filter(|k| matches!(k, TokenKind::Keyword { .. }))119 .map(TokenKind::name)120 .map(|n| format_ident!("{n}"));121122 let nodes = kinds123 .nodes124 .iter()125 .map(|name| format_ident!("{}", name))126 .collect::<Vec<_>>();127128 let enums = grammar129 .enums130 .iter()131 .map(|e| format_ident!("{}", to_upper_snake_case(&e.name)))132 .chain(133 grammar134 .token_enums135 .iter()136 .map(|e| format_ident!("{}", to_upper_snake_case(&e.name))),137 );138139 let ast = quote! {140 #![allow(bad_style, missing_docs, unreachable_pub, clippy::manual_non_exhaustive, clippy::match_like_matches_macro)]141 use logos::Logos;142143 /// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT`.144 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Logos)]145 #[repr(u16)]146 pub enum SyntaxKind {147 #[doc(hidden)]148 TOMBSTONE,149 #[doc(hidden)]150 EOF,151 #(#token_kinds,)*152 /// Also acts as __LAST_TOKEN153 #[error]154 LEXING_ERROR,155 #(#nodes,)*156 #[doc(hidden)]157 __LAST,158 }159 use self::SyntaxKind::*;160161 impl SyntaxKind {162 pub fn is_keyword(self) -> bool {163 match self {164 #(#keywords)|* => true,165 _ => false,166 }167 }168 pub fn is_enum(self) -> bool {169 match self {170 #(#enums)|* => true,171 _ => false,172 }173 }174175 pub fn from_raw(r: u16) -> Self {176 assert!(r < Self::__LAST as u16);177 unsafe { std::mem::transmute(r) }178 }179 pub fn into_raw(self) -> u16 {180 self as u16181 }182 }183184 #[macro_export]185 macro_rules! T {#(#t_macros);*}186 pub use T;187 };188189 reformat(&ast.to_string())190}191192fn generate_nodes(kinds: &KindsSrc, grammar: &AstSrc) -> Result<String> {193 let (node_defs, node_boilerplate_impls): (Vec<_>, Vec<_>) = grammar194 .nodes195 .iter()196 .map(|node| {197 let name = format_ident!("{}", node.name);198 let kind = format_ident!("{}", to_upper_snake_case(&node.name));199 let traits = node.traits.iter().map(|trait_name| {200 let trait_name = format_ident!("{}", trait_name);201 quote!(impl ast::#trait_name for #name {})202 });203204 let methods = node.fields.iter().map(|field| {205 let method_name = field.method_name(kinds);206 let ty = field.ty();207208 if field.is_many() {209 quote! {210 pub fn #method_name(&self) -> AstChildren<#ty> {211 support::children(&self.syntax)212 }213 }214 } else if let Some(token_kind) = field.token_kind(kinds) {215 quote! {216 pub fn #method_name(&self) -> Option<#ty> {217 support::token(&self.syntax, #token_kind)218 }219 }220 } else if field.is_token_enum(grammar) {221 quote! {222 pub fn #method_name(&self) -> Option<#ty> {223 support::token_child(&self.syntax)224 }225 }226 } else {227 quote! {228 pub fn #method_name(&self) -> Option<#ty> {229 support::child(&self.syntax)230 }231 }232 }233 });234 (235 quote! {236 #[pretty_doc_comment_placeholder_workaround]237 #[derive(Debug, Clone, PartialEq, Eq, Hash)]238 pub struct #name {239 pub(crate) syntax: SyntaxNode,240 }241242 #(#traits)*243244 impl #name {245 #(#methods)*246 }247 },248 quote! {249 impl AstNode for #name {250 fn can_cast(kind: SyntaxKind) -> bool {251 kind == #kind252 }253 fn cast(syntax: SyntaxNode) -> Option<Self> {254 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }255 }256 fn syntax(&self) -> &SyntaxNode { &self.syntax }257 }258 },259 )260 })261 .unzip();262263 let (enum_defs, enum_boilerplate_impls): (Vec<_>, Vec<_>) = grammar264 .enums265 .iter()266 .map(|en| {267 let variants: Vec<_> = en268 .variants269 .iter()270 .map(|var| format_ident!("{}", var))271 .collect();272 let name = format_ident!("{}", en.name);273 let kinds: Vec<_> = variants274 .iter()275 .map(|name| format_ident!("{}", to_upper_snake_case(&name.to_string())))276 .collect();277 let traits = en.traits.iter().map(|trait_name| {278 let trait_name = format_ident!("{}", trait_name);279 quote!(impl ast::#trait_name for #name {})280 });281282 let ast_node = quote! {283 impl AstNode for #name {284 fn can_cast(kind: SyntaxKind) -> bool {285 match kind {286 #(#kinds)|* => true,287 _ => false,288 }289 }290 fn cast(syntax: SyntaxNode) -> Option<Self> {291 let res = match syntax.kind() {292 #(293 #kinds => #name::#variants(#variants { syntax }),294 )*295 _ => return None,296 };297 Some(res)298 }299 fn syntax(&self) -> &SyntaxNode {300 match self {301 #(302 #name::#variants(it) => &it.syntax,303 )*304 }305 }306 }307 };308309 (310 quote! {311 #[pretty_doc_comment_placeholder_workaround]312 #[derive(Debug, Clone, PartialEq, Eq, Hash)]313 pub enum #name {314 #(#variants(#variants),)*315 }316317 #(#traits)*318 },319 quote! {320 #(321 impl From<#variants> for #name {322 fn from(node: #variants) -> #name {323 #name::#variants(node)324 }325 }326 )*327 #ast_node328 },329 )330 })331 .unzip();332333 let (token_enum_defs, token_enum_boilerplate_impls): (Vec<_>, Vec<_>) = grammar334 .token_enums335 .iter()336 .map(|en| {337 let variants: Vec<_> = en338 .variants339 .iter()340 .map(|token| {341 format_ident!(342 "{}",343 to_pascal_case(kinds.token(token).expect("token exists").name())344 )345 })346 .collect();347 let name = format_ident!("{}", en.name);348 let kind_name = format_ident!("{}Kind", en.name);349 let kinds: Vec<_> = variants350 .iter()351 .map(|name| format_ident!("{}", to_upper_snake_case(&name.to_string())))352 .collect();353354 let ast_node = quote! {355 impl AstToken for #name {356 fn can_cast(kind: SyntaxKind) -> bool {357 #kind_name::can_cast(kind)358 }359 fn cast(syntax: SyntaxToken) -> Option<Self> {360 let kind = #kind_name::cast(syntax.kind())?;361 Some(#name { syntax, kind })362 }363 fn syntax(&self) -> &SyntaxToken {364 &self.syntax365 }366 }367368 impl #kind_name {369 fn can_cast(kind: SyntaxKind) -> bool {370 match kind {371 #(#kinds)|* => true,372 _ => false,373 }374 }375 pub fn cast(kind: SyntaxKind) -> Option<Self> {376 let res = match kind {377 #(#kinds => Self::#variants,)*378 _ => return None,379 };380 Some(res)381 }382 }383 };384385 (386 quote! {387 #[pretty_doc_comment_placeholder_workaround]388 #[derive(Debug, Clone, PartialEq, Eq, Hash)]389 pub struct #name { syntax: SyntaxToken, kind: #kind_name }390391 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]392 pub enum #kind_name {393 #(#variants,)*394 }395 },396 quote! {397 #ast_node398399 impl #name {400 pub fn kind(&self) -> #kind_name {401 self.kind402 }403 }404405 impl std::fmt::Display for #name {406 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {407 std::fmt::Display::fmt(self.syntax(), f)408 }409 }410 },411 )412 })413 .unzip();414415 let (any_node_defs, any_node_boilerplate_impls): (Vec<_>, Vec<_>) = grammar416 .nodes417 .iter()418 .flat_map(|node| node.traits.iter().map(move |t| (t, node)))419 .into_group_map()420 .into_iter()421 .sorted_by_key(|(k, _)| *k)422 .map(|(trait_name, nodes)| {423 let name = format_ident!("Any{}", trait_name);424 let trait_name = format_ident!("{}", trait_name);425 let kinds: Vec<_> = nodes426 .iter()427 .map(|name| format_ident!("{}", to_upper_snake_case(&name.name.to_string())))428 .collect();429430 (431 quote! {432 #[pretty_doc_comment_placeholder_workaround]433 #[derive(Debug, Clone, PartialEq, Eq, Hash)]434 pub struct #name {435 pub(crate) syntax: SyntaxNode,436 }437 impl ast::#trait_name for #name {}438 },439 quote! {440 impl #name {441 #[inline]442 pub fn new<T: ast::#trait_name>(node: T) -> #name {443 #name {444 syntax: node.syntax().clone()445 }446 }447 }448 impl AstNode for #name {449 fn can_cast(kind: SyntaxKind) -> bool {450 match kind {451 #(#kinds)|* => true,452 _ => false,453 }454 }455 fn cast(syntax: SyntaxNode) -> Option<Self> {456 Self::can_cast(syntax.kind()).then(|| #name { syntax })457 }458 fn syntax(&self) -> &SyntaxNode {459 &self.syntax460 }461 }462 },463 )464 })465 .unzip();466467 let enum_names = grammar.enums.iter().map(|it| &it.name);468 let node_names = grammar.nodes.iter().map(|it| &it.name);469470 let display_impls = enum_names471 .chain(node_names.clone())472 .map(|it| format_ident!("{}", it))473 .map(|name| {474 quote! {475 impl std::fmt::Display for #name {476 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {477 std::fmt::Display::fmt(self.syntax(), f)478 }479 }480 }481 });482483 let ast = quote! {484 #![allow(non_snake_case, clippy::match_like_matches_macro)]485486 use crate::{487 SyntaxNode, SyntaxToken, SyntaxKind::{self, *},488 ast::{AstNode, AstToken, AstChildren, support},489 T,490 };491492 #(#node_defs)*493 #(#enum_defs)*494 #(#token_enum_defs)*495 #(#any_node_defs)*496 #(#node_boilerplate_impls)*497 #(#enum_boilerplate_impls)*498 #(#token_enum_boilerplate_impls)*499 #(#any_node_boilerplate_impls)*500 #(#display_impls)*501 };502503 let ast = ast.to_string().replace("T ! [", "T![");504505 let mut res = String::with_capacity(ast.len() * 2);506507 let mut docs = grammar508 .nodes509 .iter()510 .map(|it| &it.doc)511 .chain(grammar.enums.iter().map(|it| &it.doc));512513 for chunk in ast.split("# [pretty_doc_comment_placeholder_workaround] ") {514 res.push_str(chunk);515 if let Some(doc) = docs.next() {516 write_doc_comment(doc, &mut res);517 }518 }519520 let res = reformat(&res)?;521 Ok(res.replace("#[derive", "\n#[derive"))522}523524fn write_doc_comment(contents: &[String], dest: &mut String) {525 use std::fmt::Write;526 for line in contents {527 writeln!(dest, "///{}", line).unwrap();528 }529}530531pub fn escape_token_macro(token: &str) -> TokenStream {532 if "{}[]()$".contains(token) {533 let c = token.chars().next().unwrap();534 quote! { #c }535 } else if token.contains('$') {536 quote! { #token }537 } else {538 let cs = token.chars().map(|c| Punct::new(c, Spacing::Joint));539 quote! { #(#cs)* }540 }541}