diff --git a/.gitignore b/.gitignore index 11f0ae3b975..4664f300111 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,10 @@ tooling/noirc_abi_wasm/nodejs tooling/noirc_abi_wasm/web tooling/noir_js/lib +# Doc-generator +tooling/doc_generator/generated_doc/* +!tooling/doc_generator/generated_doc/.gitkeep + **/package.tgz packages diff --git a/Cargo.lock b/Cargo.lock index 43958d2f1cb..9fc00771a49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,11 +95,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] @@ -121,21 +121,22 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -177,15 +178,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -257,7 +258,7 @@ dependencies = [ "ark-std", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "zeroize", ] @@ -274,7 +275,7 @@ dependencies = [ "ark-std", "derivative", "digest", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -357,6 +358,50 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", + "humansize", + "num-traits", + "percent-encoding", +] + +[[package]] +name = "askama_derive" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.39", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4" +dependencies = [ + "nom", +] + [[package]] name = "assert_cmd" version = "2.0.12" @@ -364,9 +409,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" dependencies = [ "anstyle", - "bstr 1.6.0", + "bstr 1.7.0", "doc-comment", - "predicates 3.0.3", + "predicates 3.0.4", "predicates-core", "predicates-tree", "wait-timeout", @@ -381,7 +426,7 @@ dependencies = [ "anstyle", "doc-comment", "globwalk", - "predicates 3.0.3", + "predicates 3.0.4", "predicates-core", "predicates-tree", "tempfile", @@ -442,9 +487,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -485,9 +530,9 @@ checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -495,6 +540,15 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "basic-toml" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +dependencies = [ + "serde", +] + [[package]] name = "bb_abstraction_leaks" version = "0.11.0" @@ -536,9 +590,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitmaps" @@ -610,20 +664,20 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", - "regex-automata 0.3.3", + "regex-automata 0.4.3", "serde", ] [[package]] name = "build-data" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac83c47416b2db78a5a8a45d7d229a730b62806fa41ac6b4dbde6d016798776" +checksum = "aed3884e2cab7c973c8fd2d150314b6a932df7fdc830edcaf1e8e7c4ae9db3c0" dependencies = [ "chrono", "safe-lock", @@ -638,9 +692,9 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -666,27 +720,27 @@ dependencies = [ [[package]] name = "bytecount" -version = "0.6.3" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "camino" @@ -699,9 +753,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -728,9 +782,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -740,17 +797,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -819,7 +874,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -928,9 +983,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const-str" @@ -940,24 +995,34 @@ checksum = "aca749d3d3f5b87a0d6100509879f9cf486ab510803a4a4e1001da1ff61c2bd6" [[package]] name = "const_format" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -979,18 +1044,18 @@ dependencies = [ [[package]] name = "cpp_demangle" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee34052ee3d93d6d8f3e6f81d85c47921f6653a19a7b70e939e3e602d893a674" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" dependencies = [ "cfg-if", ] [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -1099,7 +1164,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -1120,7 +1185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1190,9 +1255,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", "itoa", @@ -1202,9 +1267,9 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" dependencies = [ "memchr", ] @@ -1230,7 +1295,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -1241,7 +1306,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -1251,7 +1316,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "lock_api", "once_cell", "parking_lot_core", @@ -1278,10 +1343,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ + "powerfmt", "serde", ] @@ -1360,6 +1426,16 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "doc-generator" +version = "0.1.0" +dependencies = [ + "askama", + "clap", + "noirc_frontend", + "thiserror", +] + [[package]] name = "easy-repl" version = "0.2.1" @@ -1389,9 +1465,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -1427,9 +1503,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1462,9 +1538,9 @@ dependencies = [ [[package]] name = "enumset" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] @@ -1478,7 +1554,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -1489,9 +1565,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -1585,9 +1661,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1636,9 +1712,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1650,9 +1726,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1660,44 +1736,44 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1741,9 +1817,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -1765,9 +1841,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -1777,12 +1853,12 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1391ab1f92ffcc08911957149833e682aa3fe252b9f45f966d2ef972274c97df" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", - "bstr 1.6.0", + "bstr 1.7.0", "fnv", "log", "regex", @@ -1836,9 +1912,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1883,14 +1959,14 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -1909,9 +1985,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1958,9 +2034,18 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] [[package]] name = "hyper" @@ -1979,7 +2064,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1988,9 +2073,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -2120,23 +2205,23 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "serde", ] [[package]] name = "inferno" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fb7c1b80a1dfa604bb4a649a5c5aeef3d913f7c520cb42b40e534e8a61bcdfc" +checksum = "c50453ec3a6555fad17b1cd1a80d16af5bc7cb35094f64e429fd46549018c6a3" dependencies = [ - "ahash 0.8.3", - "indexmap 1.9.3", + "ahash 0.8.6", + "indexmap 2.1.0", "is-terminal", "itoa", "log", @@ -2149,9 +2234,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -2177,6 +2262,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -2227,27 +2321,38 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -2255,9 +2360,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "louds-rs" @@ -2305,9 +2410,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2327,6 +2432,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2360,6 +2474,22 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2371,9 +2501,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -2506,14 +2636,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "static_assertions", ] [[package]] @@ -2691,6 +2820,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -2699,9 +2838,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -2730,9 +2869,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2750,9 +2889,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -2798,15 +2937,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -2867,9 +3006,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2921,6 +3060,12 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "pprof" version = "0.12.1" @@ -2934,7 +3079,7 @@ dependencies = [ "inferno", "libc", "log", - "nix 0.26.2", + "nix 0.26.4", "once_cell", "parking_lot", "smallvec", @@ -2957,7 +3102,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -2965,13 +3110,13 @@ dependencies = [ [[package]] name = "predicates" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" dependencies = [ "anstyle", "difflib", - "itertools", + "itertools 0.11.0", "predicates-core", ] @@ -3037,9 +3182,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -3052,13 +3197,13 @@ checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.3.3", + "bitflags 2.4.1", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.7.5", "rusty-fork", "tempfile", "unarray", @@ -3101,9 +3246,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3194,30 +3339,30 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] @@ -3235,14 +3380,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -3253,20 +3398,26 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "region" @@ -3282,18 +3433,18 @@ dependencies = [ [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "base64", "bytes", @@ -3317,6 +3468,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-rustls", "tower-service", @@ -3341,26 +3493,25 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.36" +version = "0.8.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" +checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" dependencies = [ "bytemuck", ] [[package]] name = "ring" -version = "0.16.20" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -3413,7 +3564,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.26", + "syn 2.0.39", "walkdir", ] @@ -3451,11 +3602,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -3464,9 +3615,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring", @@ -3485,9 +3636,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -3559,11 +3710,11 @@ checksum = "077d73db7973cccf63eb4aff1e5a34dc2459baa867512088269ea5f2f4253c90" [[package]] name = "safe-proc-macro2" -version = "1.0.36" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "814c536dcd27acf03296c618dab7ad62d28e70abd7ba41d3f34a2ce707a2c666" +checksum = "7fd85be67db87168aa3c13fd0da99f48f2ab005dccad5af5626138dc1df20eb6" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -3627,9 +3778,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -3672,9 +3823,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.179" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5bf42b8d227d4abf38a1ddb08602e229108a517cd4e5bb28f9c7eaafdce5c0" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] @@ -3717,13 +3868,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.179" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "741e124f5485c7e60c03b043f79f320bff3527f4bbf12cf3831750dc46a0ec2c" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -3739,20 +3890,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.14" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -3771,15 +3922,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1402f54f9a3b9e2efe71c1cea24e648acce55887983553eeb858cf3115acfd49" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_json", "serde_with_macros", @@ -3788,21 +3939,21 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9197f1ad0e3c173a0222d3c4404fb04c3afe87e962bcb327af73e8301fa203c7" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3821,9 +3972,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -3907,9 +4058,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3931,9 +4082,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smawk" @@ -3952,19 +4103,29 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" @@ -3982,12 +4143,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "str-buf" version = "1.0.6" @@ -4033,21 +4188,21 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "symbolic-common" -version = "12.3.0" +version = "12.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167a4ffd7c35c143fd1030aa3c2caf76ba42220bd5a6b5f4781896434723b8c3" +checksum = "6d3aa424281de488c1ddbaffb55a421ad87d04b0fdd5106e7e71d748c0c71ea6" dependencies = [ "debugid", - "memmap2 0.5.10", + "memmap2 0.8.0", "stable_deref_trait", "uuid", ] [[package]] name = "symbolic-demangle" -version = "12.3.0" +version = "12.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e378c50e80686c1c5c205674e1f86a2858bec3d2a7dfdd690331a8a19330f293" +checksum = "9bdcf77effe2908a21c1011b4d49a7122e0f44487a6ad89db67c55a1687e2572" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -4067,15 +4222,36 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -4095,19 +4271,19 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "rustix", "windows-sys 0.48.0", ] @@ -4125,9 +4301,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -4174,22 +4350,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -4204,12 +4380,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -4217,15 +4394,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4257,18 +4434,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -4281,7 +4457,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] @@ -4296,9 +4472,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -4311,9 +4487,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -4323,20 +4499,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -4368,11 +4544,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4381,20 +4556,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -4438,9 +4613,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unarray" @@ -4448,6 +4623,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -4456,9 +4640,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-linebreak" @@ -4483,9 +4667,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -4495,15 +4679,15 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4519,9 +4703,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" [[package]] name = "valuable" @@ -4556,9 +4740,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -4602,7 +4786,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -4659,7 +4843,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4918,9 +5102,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -4933,11 +5117,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.50.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6041b3f84485c21b57acdc0fee4f4f0c93f426053dc05fa5d6fc262537bbff" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4968,7 +5152,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4988,17 +5172,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5009,9 +5193,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5027,9 +5211,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5045,9 +5229,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5063,9 +5247,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5081,9 +5265,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5093,9 +5277,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5111,15 +5295,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.0" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -5152,6 +5336,26 @@ dependencies = [ "libc", ] +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -5169,5 +5373,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.39", ] diff --git a/Cargo.toml b/Cargo.toml index 5738fe94984..0a2cd359594 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ members = [ "tooling/bb_abstraction_leaks", "tooling/lsp", "tooling/debugger", + "tooling/doc_generator", "tooling/nargo", "tooling/nargo_fmt", "tooling/nargo_cli", @@ -77,6 +78,7 @@ nargo_cli = { path = "tooling/nargo_cli" } nargo_toml = { path = "tooling/nargo_toml" } noir_lsp = { path = "tooling/lsp" } noir_debugger = { path = "tooling/debugger" } +doc_generator ={ path = "tooling/doc_generator"} noirc_abi = { path = "tooling/noirc_abi" } bb_abstraction_leaks = { path = "tooling/bb_abstraction_leaks" } diff --git a/tooling/doc_generator/Cargo.toml b/tooling/doc_generator/Cargo.toml new file mode 100644 index 00000000000..3a30ae94e57 --- /dev/null +++ b/tooling/doc_generator/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "doc-generator" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +askama = "0.12" +thiserror.workspace = true +clap.workspace = true +noirc_frontend.workspace = true diff --git a/tooling/doc_generator/Readme.md b/tooling/doc_generator/Readme.md new file mode 100644 index 00000000000..c5a9ce011a8 --- /dev/null +++ b/tooling/doc_generator/Readme.md @@ -0,0 +1,31 @@ +# Noir doc generator + +## General information + +This program generates the documentation files for the Noir language. The input files with Noir code are placed in the `input_files` folder. When you run the program with `cargo run`, the documentation files in the `generated_doc` folder are generated. + +## Screenshots + +### Main page + +![mainpage](Screenshots/Main_page.png) + +### Code page + +![codepage](Screenshots/Code_page.png) + +### Function page + +![functionpage](Screenshots/Function_page.png) + +### Structure page + +![structpage](Screenshots/Struct_page.png) + +### Trait page + +![traitpage](Screenshots/Trait_page.png) + +### Search page + +![searchpage](Screenshots/Search_page.png) \ No newline at end of file diff --git a/tooling/doc_generator/Screenshots/Code_page.png b/tooling/doc_generator/Screenshots/Code_page.png new file mode 100644 index 00000000000..bf8b4fe40b7 Binary files /dev/null and b/tooling/doc_generator/Screenshots/Code_page.png differ diff --git a/tooling/doc_generator/Screenshots/Function_page.png b/tooling/doc_generator/Screenshots/Function_page.png new file mode 100644 index 00000000000..32d989c0daf Binary files /dev/null and b/tooling/doc_generator/Screenshots/Function_page.png differ diff --git a/tooling/doc_generator/Screenshots/Main_page.png b/tooling/doc_generator/Screenshots/Main_page.png new file mode 100644 index 00000000000..0cec21c61fa Binary files /dev/null and b/tooling/doc_generator/Screenshots/Main_page.png differ diff --git a/tooling/doc_generator/Screenshots/Search_page.png b/tooling/doc_generator/Screenshots/Search_page.png new file mode 100644 index 00000000000..e70193c8689 Binary files /dev/null and b/tooling/doc_generator/Screenshots/Search_page.png differ diff --git a/tooling/doc_generator/Screenshots/Struct_page.png b/tooling/doc_generator/Screenshots/Struct_page.png new file mode 100644 index 00000000000..ab095bca700 Binary files /dev/null and b/tooling/doc_generator/Screenshots/Struct_page.png differ diff --git a/tooling/doc_generator/Screenshots/Trait_page.png b/tooling/doc_generator/Screenshots/Trait_page.png new file mode 100644 index 00000000000..2c8f352af6f Binary files /dev/null and b/tooling/doc_generator/Screenshots/Trait_page.png differ diff --git a/tooling/doc_generator/Screenshots/search.png b/tooling/doc_generator/Screenshots/search.png new file mode 100644 index 00000000000..c131311b6e1 Binary files /dev/null and b/tooling/doc_generator/Screenshots/search.png differ diff --git a/tooling/doc_generator/generated_doc/.gitkeep b/tooling/doc_generator/generated_doc/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tooling/doc_generator/input_files/another_module.nr b/tooling/doc_generator/input_files/another_module.nr new file mode 100644 index 00000000000..b754dde231b --- /dev/null +++ b/tooling/doc_generator/input_files/another_module.nr @@ -0,0 +1,12 @@ +fn main1(x : Field, y : pub Field) { + assert(x != y); +} + +struct MyStruct1 { + mana: i32, + name: String, +} + +impl MyStruct1 { + fn new() {} +} diff --git a/tooling/doc_generator/input_files/function_example.nr b/tooling/doc_generator/input_files/function_example.nr new file mode 100644 index 00000000000..e8357417049 --- /dev/null +++ b/tooling/doc_generator/input_files/function_example.nr @@ -0,0 +1,4 @@ +///doc comment +fn main(x : Field, y : pub Field) { + assert(x != y); +} \ No newline at end of file diff --git a/tooling/doc_generator/input_files/impl_example.nr b/tooling/doc_generator/input_files/impl_example.nr new file mode 100644 index 00000000000..4c3d1c3a63c --- /dev/null +++ b/tooling/doc_generator/input_files/impl_example.nr @@ -0,0 +1,8 @@ +// Map + struct B {} + +impl B { + fn new(new_concrete_t_c_constructor: fn () -> T_C) -> B { + B { new_concrete_t_c_constructor } + } +} \ No newline at end of file diff --git a/tooling/doc_generator/input_files/prog.nr b/tooling/doc_generator/input_files/prog.nr new file mode 100644 index 00000000000..715b17cf45d --- /dev/null +++ b/tooling/doc_generator/input_files/prog.nr @@ -0,0 +1,266 @@ +//! Note the documentation for the primitives **str** and **[T]** (also +//! called 'slice'). Many method calls on **String** and **Vec** are actually +//! calls to methods on **str** and **[T]** respectively, via **deref +//! coercions**. + + + +///doc comment +/* + This is a block comment describing a complex function. +*/ +fn main(x : Field, y : pub Field) { + assert(x != y); +} + +///qwe +///rty +fn simple_fn(){} + +///qwe +///rty +pub fn pub_fn(){} + +//! Data available to helper can be found in [Helper](struct.Helper.html). And there are more +//! examples in [HelperDef](trait.HelperDef.html) page. +//! +//! You can learn more about helpers by looking into source code of built-in helpers. +//! +//! Like our JavaScript counterparts, handlebars allows user to define simple helpers with +//! a scripting language, [rhai](https://docs.rs/crate/rhai/). This can be enabled by +//! turning on `script_helper` feature flag. + +/// struct +struct MyStruct { + mana: i32, + name: String, +} + +///a +///lot +///of +/** +doc +comments +*/ +fn another_fn(){} + +/// com 1 +/// com 2 +pub struct AnotherStruct { + pub name: String, + pub number: i32, +} + +impl MyStruct { + fn new() {} +} + +impl MyStruct { + /// Create a new `Uniform` instance which samples uniformly from the half + /// open range `[low, high)` (excluding `high`). Panics if `low >= high`. + pub fn new(low: B1, high: B2) -> Uniform + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized, + { + Uniform(X::Sampler::new(low, high)) + } + + /// Create a new `Uniform` instance which samples uniformly from the closed + /// range `[low, high]` (inclusive). Panics if `low > high`. + pub fn new_inclusive(low: B1, high: B2) -> Uniform + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized, + { + Uniform(X::Sampler::new_inclusive(low, high)) + } +} + +/// Range that supports generating a single sample efficiently. +/// +/// Any type implementing this trait can be used to specify the sampled range +/// for `Rng::gen_range`. +pub trait SampleRange { + /// Generate a sample from the given range. + fn sample_single(self, rng: &mut R) -> T; + + /// Check whether the range is empty. + fn is_empty(&self) -> bool; +} + +impl SampleRange for AnotherStruct { + #[inline] + fn sample_single(self, rng: &mut R) -> T { + T::Sampler::sample_single(self.start, self.end, rng) + } + + #[inline] + fn is_empty(&self) -> bool { + !(self.start < self.end) + } +} + +/// this is a trait =-= +//! Helper trait handling actual uniform sampling. +//! +//! See the [module documentation] on how to implement [`Uniform`] range +//! sampling for a custom type. +//! +//! Implementation of [`sample_single`] is optional, and is only useful when +//! the implementation can be faster than `Self::new(low, high).sample(rng)`. +//! +//! [module documentation]: crate::distributions::uniform +//! [`sample_single`]: UniformSampler::sample_single +pub trait UniformSampler: Sized { + /// The type sampled by this implementation. + type X; + + /// Construct self, with inclusive lower bound and exclusive upper bound + /// `[low, high)`. + /// + /// Usually users should not call this directly but instead use + /// `Uniform::new`, which asserts that `low < high` before calling this. + fn new(low: B1, high: B2) -> Self + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized; + + /// Construct self, with inclusive bounds `[low, high]`. + /// + /// Usually users should not call this directly but instead use + /// `Uniform::new_inclusive`, which asserts that `low <= high` before + /// calling this. + fn new_inclusive(low: B1, high: B2) -> Self + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized; + + /// Sample a value. + fn sample(&self, rng: &mut R) -> Self::X; + + /// Sample a single value uniformly from a range with inclusive lower bound + /// and exclusive upper bound `[low, high)`. + /// + /// By default this is implemented using + /// `UniformSampler::new(low, high).sample(rng)`. However, for some types + /// more optimal implementations for single usage may be provided via this + /// method (which is the case for integers and floats). + /// Results may not be identical. + /// + /// Note that to use this method in a generic context, the type needs to be + /// retrieved via `SampleUniform::Sampler` as follows: + /// ``` + /// use rand::{thread_rng, distributions::uniform::{SampleUniform, UniformSampler}}; + /// # #[allow(unused)] + /// fn sample_from_range(lb: T, ub: T) -> T { + /// let mut rng = thread_rng(); + /// ::Sampler::sample_single(lb, ub, &mut rng) + /// } + /// ``` + fn sample_single(low: B1, high: B2, rng: &mut R) -> Self::X + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized, + { + let uniform: Self = UniformSampler::new(low, high); + uniform.sample(rng) + } + + fn new_fn() -> i32; + + /// Sample a single value uniformly from a range with inclusive lower bound + /// and inclusive upper bound `[low, high]`. + /// + /// By default this is implemented using + /// `UniformSampler::new_inclusive(low, high).sample(rng)`. However, for + /// some types more optimal implementations for single usage may be provided + /// via this method. + /// Results may not be identical. + fn sample_single_inclusive(low: B1, high: B2, rng: &mut R) + -> Self::X + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let uniform: Self = UniformSampler::new_inclusive(low, high); + uniform.sample(rng) + } +} + +impl UniformSampler for UniformChar { + type X = char; + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new(low_b: B1, high_b: B2) -> Self + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized, + { + let low = char_to_comp_u32(*low_b.borrow()); + let high = char_to_comp_u32(*high_b.borrow()); + let sampler = UniformInt::::new(low, high); + UniformChar { sampler } + } + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new_inclusive(low_b: B1, high_b: B2) -> Self + where + B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized, + { + let low = char_to_comp_u32(*low_b.borrow()); + let high = char_to_comp_u32(*high_b.borrow()); + let sampler = UniformInt::::new_inclusive(low, high); + UniformChar { sampler } + } + + fn sample(&self, rng: &mut R) -> Self::X { + let mut x = self.sampler.sample(rng); + if x >= CHAR_SURROGATE_START { + x += CHAR_SURROGATE_LEN; + } + // SAFETY: x must not be in surrogate range or greater than char::MAX. + // This relies on range constructors which accept char arguments. + // Validity of input char values is assumed. + unsafe { core::char::from_u32_unchecked(x) } + } +} + +mod MyModule { + ///module function + fn module_fn() { + let a = 100; + } + + struct MyStruct { + mana: i32, + name: String, + } +} + +mod another_module; + +fn yes () {} + +struct GrumpkinScalar { + low: Field, + high: Field, +} + +struct B {} + + +fn sss(new_concrete_t_c_constructor: fn () -> T_C) -> B { + B { new_concrete_t_c_constructor } +} + +impl B { + fn new(new_concrete_t_c_constructor: fn () -> T_C) -> B { + B { new_concrete_t_c_constructor } + } +} + +fn abc(){} diff --git a/tooling/doc_generator/input_files/struct_example.nr b/tooling/doc_generator/input_files/struct_example.nr new file mode 100644 index 00000000000..90e8ff2b8a9 --- /dev/null +++ b/tooling/doc_generator/input_files/struct_example.nr @@ -0,0 +1,4 @@ +struct GrumpkinScalar { + low: Field, + high: Field, +} \ No newline at end of file diff --git a/tooling/doc_generator/input_files/trait_example.nr b/tooling/doc_generator/input_files/trait_example.nr new file mode 100644 index 00000000000..288daf01b04 --- /dev/null +++ b/tooling/doc_generator/input_files/trait_example.nr @@ -0,0 +1,2 @@ +trait MyTrait { +} \ No newline at end of file diff --git a/tooling/doc_generator/src/getters.rs b/tooling/doc_generator/src/getters.rs new file mode 100644 index 00000000000..03688636c5d --- /dev/null +++ b/tooling/doc_generator/src/getters.rs @@ -0,0 +1,502 @@ +use std::{ + fs::File, + io::{BufRead, BufReader, Read}, +}; + +use askama::Template; +use noirc_frontend::{ + hir::resolution::errors::Span, + lexer::Lexer, + token::{DocStyle, Keyword, SpannedToken, Token}, +}; + +use crate::{Function, Output}; + +/// Retrieves the content of a module from a list of tokens and the starting index. + +/// The `get_module_content` function is designed to obtain the content of a module based on +/// a list of `tokens` and the starting index `index`. It looks for a module description that +/// begins at the index `index` and may be terminated by either semicolons `;` or curly braces `{}`. +/// If the module is terminated by semicolons `;`, the function loads the module content from a file +/// whose name is specified before the semicolon in the list of tokens. +pub(crate) fn get_module_content( + tokens: &[Token], + index: usize, +) -> Result, crate::DocError> { + let mut content = Vec::new(); + let mut i = index; + let mut brace_counter = 0; + + loop { + match &tokens[i] { + Token::Semicolon => { + let filename = format!("input_files/{}.nr", tokens[i - 1]); + content = get_doc(&filename).map_err(|_| crate::DocError::GetDocError)?; + break; + } + Token::LeftBrace => { + brace_counter += 1; + i += 1; + while brace_counter != 0 { + match &tokens[i] { + Token::LeftBrace => { + brace_counter += 1; + content + .push(SpannedToken::new(tokens[i].clone(), Span::inclusive(0, 1))); + i += 1; + } + Token::RightBrace => { + brace_counter -= 1; + content + .push(SpannedToken::new(tokens[i].clone(), Span::inclusive(0, 1))); + i += 1; + } + _ => { + content + .push(SpannedToken::new(tokens[i].clone(), Span::inclusive(0, 1))); + i += 1; + } + } + } + break; + } + _ => { + i += 1; + } + }; + } + + let res = Output::to_output(content)?; + + Ok(res) +} + +/// Skips an implementation block within a list of tokens, starting at the given index. + +/// The `skip_impl_block` function is used to skip an implementation block within a list of tokens. +/// It starts at the specified index and continues until it finds the closing curly brace `}` of +/// the implementation block. This function is useful when you want to ignore or bypass an +/// implementation block in the token list. +pub(crate) fn skip_impl_block(tokens: &[Token], index: usize) -> usize { + let mut brace_counter = 0; + let mut i = index; + + while brace_counter != 1 { + match &tokens[i] { + Token::LeftBrace => { + i += 1; + brace_counter += 1; + } + _ => { + i += 1; + } + } + } + + while brace_counter != 0 { + match &tokens[i] { + Token::LeftBrace => { + i += 1; + brace_counter += 1; + } + Token::RightBrace => { + i += 1; + brace_counter -= 1; + } + _ => { + i += 1; + } + } + } + + i - index - 1 +} + +pub(crate) fn fn_signature(tokens: &[Token], index: usize) -> String { + let mut res = String::new(); + let mut i = index; + loop { + match &tokens[i] { + Token::LeftBrace | Token::Semicolon => { + break; + } + _ => { + res.push_str(&tokens[i].to_string()); + res.push(' '); + i += 1; + } + }; + } + res +} + +/// Extracts the function signature from a list of tokens starting at the given index. + +/// The `fn_signature` function is designed to extract the function signature from a list of tokens. +/// It starts at the specified index and continues until it encounters a left curly brace `{` or a semicolon `;`, +/// indicating the start of the function's body or the end of the signature. The function returns the extracted +/// function signature as a string. +pub(crate) fn struct_signature(tokens: &[Token], index: usize) -> String { + let mut res = String::new(); + let mut i = index; + let mut is_private = true; + + loop { + match &tokens[i] { + Token::LeftBrace => { + res.push('{'); + res.push('\n'); + loop { + match tokens[i] { + Token::RightBrace => { + if is_private { + res.push_str("/* private fields */"); + } + res.push('\n'); + res.push('}'); + break; + } + Token::Keyword(Keyword::Pub) => { + is_private = false; + loop { + match tokens[i] { + Token::Comma => { + if tokens[i + 1] == Token::RightBrace { + res.push(','); + } else { + res.push_str(",\n"); + } + i += 1; + break; + } + Token::RightBrace => { + break; + } + _ => { + res.push_str(&tokens[i].to_string()); + res.push(' '); + i += 1; + } + } + } + } + _ => { + i += 1; + } + } + } + break; + } + _ => { + res.push_str(&tokens[i].to_string()); + res.push(' '); + i += 1; + } + }; + } + + res +} + +/// Extracts information about a trait from a list of tokens starting at the given index. + +/// The `trait_info` function is used to extract information about a trait from a list of tokens. +/// It starts at the specified index and continues until it collects details about the trait's signature, +/// required methods, and provided methods. The extracted information is returned as a tuple, including +/// the trait's signature as a string, a vector of required methods, and a vector of provided methods. +pub(crate) fn trait_info(tokens: &[Token], index: usize) -> (String, Vec, Vec) { + let mut sign = String::new(); + let mut required_methods = Vec::new(); + let mut provided_methods = Vec::new(); + let mut i = index; + let mut brace_counter; + + loop { + match &tokens[i + 1] { + Token::LeftBrace => { + sign.push('{'); + sign.push('\n'); + loop { + match tokens[i + 1] { + Token::RightBrace => { + sign.push('}'); + break; + } + Token::Keyword(Keyword::Fn) => { + let name = match &tokens[i + 2] { + Token::Ident(idn) => idn.clone(), + _ => { + break; + } + }; + let doc = doc(tokens, i + 1); + let fn_sign = fn_signature(tokens, i + 1); + + loop { + match tokens[i + 1] { + Token::Semicolon => { + required_methods.push(Function { + name, + doc, + signature: fn_sign, + is_method: true, + }); + sign.push(';'); + sign.push('\n'); + break; + } + Token::LeftBrace => { + provided_methods.push(Function { + name, + doc, + signature: fn_sign, + is_method: true, + }); + brace_counter = 1; + sign.push_str("{ ... }"); + sign.push('\n'); + while brace_counter != 0 { + i += 1; + match tokens[i + 1] { + Token::LeftBrace => { + brace_counter += 1; + } + Token::RightBrace => { + brace_counter -= 1; + } + _ => {} + } + } + i += 1; + break; + } + _ => { + sign.push_str(&tokens[i + 1].to_string()); + sign.push(' '); + i += 1; + } + } + } + } + _ => { + i += 1; + } + } + } + break; + } + _ => { + sign.push_str(&tokens[i + 1].to_string()); + sign.push(' '); + i += 1; + } + }; + } + + (sign, required_methods, provided_methods) +} + +/// Extracts additional documentation preceding a code element from a list of tokens. + +/// The `additional_doc` function is used to extract any additional documentation comments that +/// appear immediately before a code element in a list of tokens. These comments are often used to +/// provide context or explanations for the code that follows. The function starts at the specified +/// index and searches for any documentation comments that precede the code element, and then returns +/// the combined documentation as a string. +pub(crate) fn additional_doc(tokens: &[Token], index: usize) -> String { + if index == 0 { + return "".to_string(); + } + match &tokens[index - 1] { + Token::LineComment(dc, Some(DocStyle::Inner)) + | Token::BlockComment(dc, Some(DocStyle::Inner)) => { + let mut res = dc.to_string(); + let mut doc_end = true; + let mut iter = 2; + while doc_end && ((index as i32) - (iter as i32)) >= 0 { + match &tokens[index - iter] { + Token::LineComment(doc, Some(DocStyle::Inner)) + | Token::BlockComment(doc, Some(DocStyle::Inner)) => { + res.insert_str(0, &doc.to_string()); + iter += 1; + } + _ => { + doc_end = false; + } + } + } + res + } + _ => { + let mut res = String::new(); + + let mut doc_find = true; + let mut iter = 2; + while doc_find && ((index as i32) - (iter as i32)) >= 0 { + match &tokens[index - iter] { + Token::LineComment(doc, Some(DocStyle::Inner)) => { + res.insert_str(0, &doc.to_string()); + iter += 1; + } + Token::Keyword(Keyword::Fn) + | Token::Keyword(Keyword::Mod) + | Token::Keyword(Keyword::Struct) + | Token::Keyword(Keyword::Trait) + | Token::Keyword(Keyword::Impl) => { + doc_find = false; + } + _ => { + iter += 1; + } + } + } + res + } + } +} + +/// Extracts documentation comments for a code element from a list of tokens. + +/// The `doc` function is used to extract documentation comments associated with a code element +/// from a list of tokens. These comments are often used to provide explanations, descriptions, +/// or comments about the code element. The function starts at the specified index and searches +/// for relevant documentation comments, and then returns the combined documentation as a string. +pub(crate) fn doc(tokens: &[Token], index: usize) -> String { + if index == 0 { + return String::new(); + } + match &tokens[index - 1] { + Token::LineComment(dc, _) | Token::BlockComment(dc, _) => { + let mut res = dc.to_string(); + let mut doc_end = true; + let mut iter = 2; + while doc_end && ((index as i32) - (iter as i32)) >= 0 { + match &tokens[index - iter] { + Token::LineComment(doc, None) | Token::BlockComment(doc, None) => { + res.insert_str(0, &doc.to_string()); + iter += 1; + } + _ => { + doc_end = false; + } + } + } + res + } + _ => { + let mut res = String::new(); + + let mut doc_find = true; + let mut iter = 2; + while doc_find && ((index as i32) - (iter as i32)) >= 0 { + match &tokens[index - iter] { + Token::LineComment(doc, Some(DocStyle::Outer)) + | Token::BlockComment(doc, Some(DocStyle::Outer)) => { + res.insert_str(0, &doc.to_string()); + iter += 1; + } + Token::Keyword(Keyword::Fn) + | Token::Keyword(Keyword::Mod) + | Token::Keyword(Keyword::Struct) + | Token::Keyword(Keyword::Trait) + | Token::Keyword(Keyword::Impl) => { + doc_find = false; + } + _ => { + iter += 1; + } + } + } + res + } + } +} + +/// Extracts an outer documentation comment associated with a code element from a list of tokens. + +/// The `outer_doc` function is used to extract an outer documentation comment associated with a +/// code element from a list of tokens. Outer documentation comments are often used to provide +/// high-level explanations or descriptions for the code element. The function starts at the +/// specified index and searches for an outer documentation comment, returning the comment as a string +/// along with the updated index. +pub(crate) fn outer_doc(tokens: &[Token], index: usize) -> (String, usize) { + let mut i = index; + let mut res = tokens[i].to_string(); + let mut doc_find = true; + while doc_find { + match &tokens[i + 1] { + Token::LineComment(doc, Some(DocStyle::Inner)) + | Token::BlockComment(doc, Some(DocStyle::Inner)) => { + res.push_str(doc); + i += 1; + } + _ => { + doc_find = false; + } + } + } + + if let Some(pos) = res.find(' ') { + res = res.split_off(pos + 1); + } else { + res.clear(); + } + + (res, i) +} + +/// Reads and tokenizes the content of a source file, returning a vector of spanned tokens. + +/// The `get_doc` function reads the content of a source file specified by the `input_file` path, +/// tokenizes the content, and returns the resulting vector of spanned tokens. This function is +/// typically used for processing source code and extracting tokens for further analysis or documentation. +pub(crate) fn get_doc(input_file: &str) -> Result, crate::DocError> { + let mut file = File::open(input_file).map_err(|_| crate::DocError::FileEditError)?; + let mut contents = String::new(); + file.read_to_string(&mut contents).map_err(|_| crate::DocError::FileEditError)?; + + let token = Lexer::new(&contents) + .skip_comments(false) + .collect::, _>>() + .map_err(|_| crate::DocError::GetTokensError)?; + + Ok(token) +} + +/// Represents a code block with associated code lines. + +/// The `Code` struct represents a code block and is typically used to group a collection of +/// code lines. It is used in conjunction with the `CodeLine` struct to create code blocks for +/// documentation purposes. +#[derive(Template)] +#[template(path = "code_template.html")] +pub(crate) struct Code { + pub(crate) codelines: Vec, +} + +/// Represents an individual line of code within a code block. + +/// The `CodeLine` struct represents an individual line of code within a code block. It is typically +/// used within a `Code` structure to create a collection of code lines for documentation or rendering purposes. +#[derive(Debug)] +pub(crate) struct CodeLine { + number: u32, + text: String, +} + +/// Reads a text file and converts its content into a vector of code lines. + +/// The `get_text` function reads the content of a text file specified by the `input_file` path, +/// and converts each line of text into a `CodeLine` structure. The resulting `CodeLine` structures +/// are collected in a vector, making it easy to work with text content as a collection of code lines. +pub(crate) fn get_text(input_file: &str) -> Result, crate::DocError> { + let file = File::open(input_file).map_err(|_| crate::DocError::FileEditError)?; + let reader = BufReader::new(file); + let mut code = Vec::new(); + + for (line, number) in reader.lines().zip(0u32..) { + code.push(CodeLine { number, text: line.map_err(|_| crate::DocError::FileEditError)? }); + } + + Ok(code) +} diff --git a/tooling/doc_generator/src/main.rs b/tooling/doc_generator/src/main.rs new file mode 100644 index 00000000000..8ea961db772 --- /dev/null +++ b/tooling/doc_generator/src/main.rs @@ -0,0 +1,131 @@ +#![forbid(unsafe_code)] +#![warn(unused_crate_dependencies, unused_extern_crates)] +#![warn(unreachable_pub)] +#![warn(clippy::semicolon_if_nothing_returned)] + +mod getters; +mod output; +mod pages_generation; +mod tests; + +use clap::{Parser, Subcommand}; +use getters::*; +use output::*; +use pages_generation::*; +use std::collections::HashMap; +use thiserror::Error; + +#[derive(Debug, Error)] +#[error("Documentation error")] +pub enum DocError { + #[error("Failed to get documentation from file")] + GetDocError, + + #[error("Failed to extract filename")] + ExtractFilenameError, + + #[error("Failed to generate module page")] + GenerateModulePageError, + + #[error("Failed to create new file")] + FileCreateError, + + #[error("Failed to edit file")] + FileEditError, + + #[error("Failed to render an object")] + RenderError, + + #[error("Failed to get information")] + GetInfoError, + + #[error("Failed to get tokens")] + GetTokensError, +} + +/// Generates documentation from the source code in the specified input file. + +/// The `generate_doc` function reads the source code from the given input file, processes it, and +/// generates documentation based on the code's structure and comments. The resulting documentation +/// is typically written to an output file or another destination. This function simplifies the +/// process of generating documentation from source code. +pub fn generate_doc(input_file: &str) -> Result<(), DocError> { + let doc = get_doc(input_file)?; + + let tokens = Output::to_output(doc); + + let filename = extract_filename(input_file).ok_or(DocError::ExtractFilenameError)?.to_string(); + + let out = AllOutput { all_output: tokens?.clone(), filename }; + + generate_module_page(out)?; + + Ok(()) +} + +/// Represents a mapping of information to corresponding documentation. + +/// The `Map` struct is used to create a mapping between information and its corresponding documentation. +/// This can be useful for organizing and retrieving documentation related to specific code elements +/// or information from the source code. +#[derive(Debug, PartialEq, Eq)] +pub struct Map { + map: HashMap, +} + +/// Retrieves and maps necessary information to documentation from a Noir code file. + +/// The `get_map` function reads a Noir code file specified by the `input_file` path, processes it, +/// and maps the necessary information to its corresponding documentation. It returns a `Map` structure +/// that provides a convenient way to access the documentation associated with various code elements. +pub fn get_map(input_file: &str) -> Result { + let mut map = HashMap::new(); + + let doc = get_doc(input_file)?; + + let tokens = Output::to_output(doc)?; + + for token in tokens.iter() { + map.insert(token.information.clone(), token.doc.clone()); + } + + Ok(Map { map }) +} + +/// Generates documentation pages based on `Noir` code +#[derive(Parser)] +#[clap(author, version, about, long_about = None)] +#[clap(propagate_version = true)] +struct Klee { + #[clap(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + /// Generates documentation from the source code in the specified input file. + GenerateDoc { + #[clap(value_parser)] + filename: String, + }, + /// Retrieves and maps necessary information to documentation from a `Noir` code file. + GetMap { + #[clap(value_parser)] + filename: String, + }, +} + +fn main() -> Result<(), DocError> { + let cli = Klee::parse(); + + match &cli.command { + Commands::GenerateDoc { filename } => { + generate_doc(filename)?; + } + Commands::GetMap { filename } => { + println!("{:#?}", get_map(filename)?); + } + } + + Ok(()) +} diff --git a/tooling/doc_generator/src/output.rs b/tooling/doc_generator/src/output.rs new file mode 100644 index 00000000000..685b048df44 --- /dev/null +++ b/tooling/doc_generator/src/output.rs @@ -0,0 +1,266 @@ +use std::fmt; + +use noirc_frontend::token::{DocStyle, Keyword, SpannedToken, Token}; + +use crate::{ + additional_doc, doc, fn_signature, get_module_content, outer_doc, skip_impl_block, + struct_signature, trait_info, Function, Implementation, +}; + +/// Represents the type or category of code element or information. + +/// The `Type` enum is used to categorize code elements or information based on their type or purpose. +/// This classification can help in organizing and processing code elements and their associated documentation. +#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] +pub(crate) enum Type { + Function, + Module, + Struct, + Trait, + OuterComment, +} + +impl fmt::Display for Type { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Type::Function => writeln!(f, "Function"), + Type::Module => writeln!(f, "Module"), + Type::Struct => writeln!(f, "Struct"), + Type::Trait => writeln!(f, "Trait"), + Type::OuterComment => writeln!(f, "OuterComment"), + } + } +} + +/// Represents detailed information about a code element. + +/// The `Info` enum provides detailed information about code elements, including their type, signature, +/// documentation, and any additional details. It is used to capture and organize information related to code elements +/// for documentation and processing purposes. +#[derive(Debug, Clone, Eq, Hash, PartialEq)] +pub(crate) enum Info { + Function { + signature: String, + }, + Module { + content: Vec, + }, + Struct { + signature: String, + additional_doc: String, + implementations: Vec, + }, + Trait { + signature: String, + additional_doc: String, + required_methods: Vec, + provided_methods: Vec, + implementations: Vec, + }, + Blanc, +} + +impl Info { + pub(crate) fn get_signature(&self) -> Option { + match self { + Info::Function { signature } => Some(signature.to_string()), + Info::Struct { signature, .. } => Some(signature.to_string()), + Info::Trait { signature, .. } => Some(signature.to_string()), + _ => None, + } + } + + pub(crate) fn get_implementations(&self) -> Option> { + match self { + Info::Struct { implementations, .. } => Some(implementations.clone()), + Info::Trait { implementations, .. } => Some(implementations.clone()), + _ => None, + } + } + + pub(crate) fn get_additional_doc(&self) -> Option { + match self { + Info::Struct { additional_doc, .. } => Some(additional_doc.to_string()), + Info::Trait { additional_doc, .. } => Some(additional_doc.to_string()), + _ => None, + } + } + + pub(crate) fn get_required_methods(&self) -> Option> { + match self { + Info::Trait { required_methods, .. } => Some(required_methods.clone()), + _ => None, + } + } + + pub(crate) fn get_provided_methods(&self) -> Option> { + match self { + Info::Trait { provided_methods, .. } => Some(provided_methods.clone()), + _ => None, + } + } + + pub(crate) fn get_content(&self) -> Option> { + match self { + Info::Module { content } => Some(content.clone()), + _ => None, + } + } +} + +/// Represents an output object that combines code information, documentation, and type details. + +/// The `Output` struct serves as a container for code-related information, documentation, and type details. +/// It allows you to bundle these attributes together, making it convenient for storing and processing code +/// elements, their associated documentation, and their categorized types. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub(crate) struct Output { + pub(crate) r#type: Type, + pub(crate) name: String, + pub(crate) doc: String, + pub(crate) information: Info, +} + +impl Output { + /// Converts a vector of spanned tokens into a vector of structured output objects. + + /// The `to_output` function processes a vector of spanned tokens, typically representing source code, + /// and converts them into a vector of structured output objects. Each output object includes information + /// about the code element, its type, name, documentation, and additional details as applicable. + pub(crate) fn to_output(input: Vec) -> Result, crate::DocError> { + let mut res = Vec::new(); + let tokens = input.into_iter().map(|x| x.into_token()).collect::>(); + let mut is_first = true; + let mut skip_count = 0; + + for i in 0..tokens.len() { + if skip_count > 0 { + skip_count -= 1; + continue; + } + let out = match &tokens[i] { + Token::Keyword(Keyword::Fn) => { + let r#type = Type::Function; + let name = match &tokens[i + 1] { + Token::Ident(idn) => idn.clone(), + _ => { + continue; + } + }; + let doc = doc(&tokens, i); + let sign = fn_signature(&tokens, i); + + Output { r#type, name, doc, information: Info::Function { signature: sign } } + } + Token::Keyword(Keyword::Struct) => { + let r#type = Type::Struct; + let name = match &tokens[i + 1] { + Token::Ident(idn) => idn.clone(), + _ => { + continue; + } + }; + let doc = doc(&tokens, i); + let sign = struct_signature(&tokens, i); + let ad_doc = additional_doc(&tokens, i); + + Output { + r#type, + name: name.clone(), + doc, + information: Info::Struct { + signature: sign, + additional_doc: ad_doc, + implementations: Implementation::get_implementations(&tokens, i, name), + }, + } + } + Token::Keyword(Keyword::Trait) => { + skip_count = skip_impl_block(&tokens, i); + + let r#type = Type::Trait; + let name = match &tokens[i + 1] { + Token::Ident(idn) => idn.clone(), + _ => { + continue; + } + }; + let doc = doc(&tokens, i); + + let ad_doc = additional_doc(&tokens, i); + let impls = Implementation::get_implementations(&tokens, i, name.clone()); + let info = trait_info(&tokens, i); + + Output { + r#type, + name, + doc, + information: Info::Trait { + signature: info.0, + additional_doc: ad_doc, + required_methods: info.1, + provided_methods: info.2, + implementations: impls, + }, + } + } + Token::Keyword(Keyword::Mod) => { + if tokens[i + 2] == Token::LeftBrace { + skip_count = skip_impl_block(&tokens, i); + } + + let r#type = Type::Module; + let name = match &tokens[i + 1] { + Token::Ident(idn) => idn.clone(), + _ => { + continue; + } + }; + let doc = doc(&tokens, i); + let content = get_module_content(&tokens, i); + + Output { r#type, name, doc, information: Info::Module { content: content? } } + } + Token::LineComment(_, Some(DocStyle::Inner)) + | Token::BlockComment(_, Some(DocStyle::Inner)) => { + let r#type = Type::OuterComment; + let name = "".to_string(); + + let res = outer_doc(&tokens, i); + + let doc = if is_first { + is_first = false; + res.0 + } else { + if res.1 == i { + is_first = true; + } + "".to_string() + }; + + Output { r#type, name, doc, information: Info::Blanc } + } + Token::Keyword(Keyword::Impl) => { + skip_count = skip_impl_block(&tokens, i); + continue; + } + _ => { + continue; + } + }; + + res.push(out); + } + + Ok(res) + } +} + +impl fmt::Display for Output { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + writeln!(f, "Type: {:?}\n", self.r#type)?; + writeln!(f, "Name: {}\n", self.name)?; + writeln!(f, "Doc: {}\n", self.doc)?; + Ok(()) + } +} diff --git a/tooling/doc_generator/src/pages_generation.rs b/tooling/doc_generator/src/pages_generation.rs new file mode 100644 index 00000000000..51b4481731f --- /dev/null +++ b/tooling/doc_generator/src/pages_generation.rs @@ -0,0 +1,381 @@ +use std::{ + ffi::OsStr, + fs::{self, File}, + io::Write, + path::Path, +}; + +use askama::Template; +use noirc_frontend::token::{Keyword, Token}; + +use crate::{doc, fn_signature, get_text, Code, Output, Type}; + +/// Generates an HTML code page from the content of a text file. + +/// The `generate_code_page` function reads the content of a text file specified by the `input_file` path, +/// processes the text content as code lines, and generates an HTML page that displays the code lines. +/// The resulting HTML page can be used for code documentation or rendering purposes. +fn generate_code_page(input_file: &str) -> Result<(), crate::DocError> { + let codelines = get_text(input_file)?; + + let code = Code { codelines }; + + let rendered_html = code.render().map_err(|_| crate::DocError::RenderError)?; + + let fname = format!( + "generated_doc/codepage_{}.html", + extract_filename(input_file).ok_or(crate::DocError::ExtractFilenameError)? + ); + + let mut file = File::create(fname).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + Ok(()) +} + +/// Represents a function with associated documentation and signature. + +/// The `Function` struct is used to represent a function, providing information about its name, +/// documentation, signature, and whether it's a method. This structure is typically used to organize +/// and process information related to functions within the code. +#[derive(Debug, Clone, Template, Eq, Hash, PartialEq)] +#[template(path = "func_template.html")] +pub(crate) struct Function { + pub(crate) name: String, + pub(crate) doc: String, + pub(crate) signature: String, + pub(crate) is_method: bool, +} + +/// Generates an HTML page for a function with associated documentation. + +/// The `generate_function_pages` function generates an HTML page for a function represented by the `func` parameter. +/// The HTML page displays the function's name, documentation, and signature. This function is typically used to +/// generate documentation pages for functions. +fn generate_function_pages(func: Function) -> Result<(), crate::DocError> { + if func.is_method { + return Ok(()); + } + let rendered_html = func.render().map_err(|_| crate::DocError::RenderError)?; + + let output_file_name = format!("generated_doc/{}.html", func.name); + + let mut file = File::create(output_file_name).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + Ok(()) +} + +/// Represents a structured code element, typically a struct, with associated documentation and details. + +/// The `Structure` struct is used to represent a structured code element, such as a struct. It provides information +/// about the name, documentation, additional documentation, signature, and implementations related to the struct. +/// This structure is designed to organize and process information related to structured code elements. +#[derive(Debug, Template)] +#[template(path = "struct_template.html")] +pub(crate) struct Structure { + name: String, + doc: String, + additional_doc: String, + signature: String, + implementations: Vec, +} + +/// Represents an implementation of methods for a code element. + +/// The `Implementation` struct provides information about the signature of an implementation and the associated +/// functions within the implementation. It is used to organize and process information related to the implementation +/// of methods for a code element. +#[derive(Debug, Clone, Eq, Hash, PartialEq)] +pub(crate) struct Implementation { + signature: String, + functions: Vec, +} + +impl Implementation { + /// Retrieves a list of implementations for a code element. + + /// The `get_implementations` method is used to retrieve a list of implementations for a code element. + /// It searches through the provided tokens and identifies implementations associated with the original code element. + pub(crate) fn get_implementations( + tokens: &[Token], + index: usize, + orig_name: String, + ) -> Vec { + let mut res = Vec::new(); + let mut functions = Vec::new(); + let mut signature = String::new(); + let mut right_impl = false; + let mut i = index; + let mut brace_counter = 0; + + while i < tokens.len() { + match tokens[i] { + Token::Keyword(Keyword::Impl) => loop { + match &tokens[i] { + Token::Ident(name) => { + if name == &orig_name { + right_impl = true; + } + signature.push_str(&tokens[i].to_string()); + signature.push(' '); + i += 1; + } + Token::LeftBrace => { + if !right_impl { + signature = "".to_string(); + break; + } else { + brace_counter += 1; + i += 1; + while brace_counter != 0 { + match &tokens[i] { + Token::Keyword(Keyword::Fn) => { + let name = match &tokens[i + 1] { + Token::Ident(idn) => idn.clone(), + _ => { + i += 1; + continue; + } + }; + let doc = doc(tokens, i); + let sign = fn_signature(tokens, i); + + functions.push(Function { + name, + doc, + signature: sign, + is_method: true, + }); + + i += 1; + } + Token::LeftBrace => { + i += 1; + brace_counter += 1; + } + Token::RightBrace => { + i += 1; + brace_counter -= 1; + } + _ => { + i += 1; + } + } + } + + res.push(Implementation { + signature: signature.clone(), + functions: functions.clone(), + }); + signature = "".to_string(); + functions = vec![]; + break; + } + } + _ => { + signature.push_str(&tokens[i].to_string()); + signature.push(' '); + i += 1; + } + } + }, + _ => { + i += 1; + } + } + } + + res + } +} + +/// Generates an HTML page for a structured code element with associated documentation. + +/// The `generate_structure_pages` function generates an HTML page for a structured code element represented by the `structure` parameter. +/// The HTML page displays information about the structured code element, including its name, documentation, signature, additional documentation, +/// and any associated implementations. This function is typically used to generate documentation pages for structured code elements. +fn generate_structure_pages(structure: Structure) -> Result<(), crate::DocError> { + let rendered_html = structure.render().map_err(|_| crate::DocError::RenderError)?; + + let output_file_name = format!("generated_doc/{}.html", structure.name); + + let mut file = File::create(output_file_name).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + Ok(()) +} + +/// Represents a trait with associated documentation, methods, and implementations. + +/// The `Trait` struct is used to represent a trait, providing information about its name, documentation, signature, +/// additional documentation, required methods, provided methods, and any associated implementations. This structure is +/// designed to organize and process information related to traits within the code. +#[derive(Debug, Template)] +#[template(path = "trait_template.html")] +pub(crate) struct Trait { + name: String, + doc: String, + signature: String, + additional_doc: String, + required_methods: Vec, + provided_methods: Vec, + implementations: Vec, +} + +/// Generates an HTML page for a trait with associated documentation, methods, and implementations. + +/// The `generate_trait_pages` function generates an HTML page for a trait represented by the `r#trait` parameter. +/// The HTML page displays information about the trait, including its name, documentation, signature, additional documentation, +/// required methods, provided methods, and any associated implementations. This function is typically used to generate +/// documentation pages for traits. +fn generate_trait_pages(r#trait: Trait) -> Result<(), crate::DocError> { + let rendered_html = r#trait.render().map_err(|_| crate::DocError::RenderError)?; + + let output_file_name = format!("generated_doc/{}.html", r#trait.name); + + let mut file = File::create(output_file_name).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + Ok(()) +} + +/// Represents a collection of code outputs and their associated filename. + +/// The `AllOutput` struct is used to group together a collection of code outputs, typically representing documentation for code elements, +/// and associate them with a specific filename. This structure is commonly used to organize and generate documentation pages that include +/// multiple code outputs from various parts of the codebase. +#[derive(Debug, Template)] +#[template(path = "doc_template.html")] +pub(crate) struct AllOutput { + pub(crate) all_output: Vec, + pub(crate) filename: String, +} + +/// Represents search results containing a list of code outputs. + +/// The `SearchResults` struct is used to represent search results containing a list of code outputs. This structure is typically used +/// when generating search result pages, allowing users to view and navigate code outputs matching their search queries. +#[derive(Debug, Template)] +#[template(path = "search_results_template.html")] +pub(crate) struct SearchResults { + results: Vec, +} + +/// Generates an HTML page for displaying search results. + +/// The `generate_search_page` function generates an HTML page to display search results provided in the `res` parameter. +/// The generated page includes a list of code outputs that match the search criteria. This function is typically used to +/// create search result pages for users searching for code documentation. +fn generate_search_page(res: SearchResults, module_name: String) -> Result<(), crate::DocError> { + let rendered_html = res.render().map_err(|_| crate::DocError::RenderError)?; + + let filename = format!("generated_doc/search_results_{}.html", module_name); + + let mut file = File::create(filename).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + Ok(()) +} + +/// Extracts the filename from a path, given the full filename with its path. + +/// The `extract_filename` function takes a full filename with its path as input and extracts the filename portion, excluding the path. +/// This function is useful when you need to isolate the filename from a file path, which can be particularly helpful when generating documentation +/// pages or handling file-related operations. +pub(crate) fn extract_filename(filename_with_path: &str) -> Option<&str> { + Path::new(filename_with_path).file_stem().and_then(OsStr::to_str) +} + +/// Generates an HTML documentation page for a module, including associated code elements. + +/// The `generate_module_page` function generates an HTML documentation page for a module and its associated code elements. +/// This page typically includes code outputs, such as functions, structs, traits, and other code constructs. It also provides +/// links to related code documentation and a search feature for easier navigation. +pub(crate) fn generate_module_page(module: AllOutput) -> Result<(), crate::DocError> { + let rendered_html = module.render().map_err(|_| crate::DocError::RenderError)?; + + let fname = format!("generated_doc/{}.html", module.filename); + + let mut file = File::create(fname).map_err(|_| crate::DocError::FileCreateError)?; + file.write_all(rendered_html.as_bytes()).map_err(|_| crate::DocError::FileEditError)?; + + let fname = format!("input_files/{}.nr", module.filename); + + if fs::metadata(&fname).is_ok() { + generate_code_page(&fname)?; + } + + let res = SearchResults { results: module.all_output.clone() }; + + generate_search_page(res, module.filename)?; + + for i in module.all_output.iter() { + match i.r#type { + Type::Function => { + generate_function_pages(Function { + name: i.name.clone(), + doc: i.doc.clone(), + signature: i + .information + .get_signature() + .ok_or(crate::DocError::GetInfoError)?, + is_method: false, + })?; + } + Type::Struct => { + generate_structure_pages(Structure { + name: i.name.clone(), + doc: i.doc.clone(), + additional_doc: i + .information + .get_additional_doc() + .ok_or(crate::DocError::GetInfoError)?, + signature: i + .information + .get_signature() + .ok_or(crate::DocError::GetInfoError)?, + implementations: i + .information + .get_implementations() + .ok_or(crate::DocError::GetInfoError)?, + })?; + } + Type::Trait => { + generate_trait_pages(Trait { + name: i.name.clone(), + doc: i.doc.clone(), + signature: i + .information + .get_signature() + .ok_or(crate::DocError::GetInfoError)?, + additional_doc: i + .information + .get_additional_doc() + .ok_or(crate::DocError::GetInfoError)?, + required_methods: i + .information + .get_required_methods() + .ok_or(crate::DocError::GetInfoError)?, + provided_methods: i + .information + .get_provided_methods() + .ok_or(crate::DocError::GetInfoError)?, + implementations: i + .information + .get_implementations() + .ok_or(crate::DocError::GetInfoError)?, + })?; + } + Type::Module => { + generate_module_page(AllOutput { + all_output: i.information.get_content().ok_or(crate::DocError::GetInfoError)?, + filename: i.name.clone(), + })?; + } + _ => {} + } + } + + Ok(()) +} diff --git a/tooling/doc_generator/src/tests.rs b/tooling/doc_generator/src/tests.rs new file mode 100644 index 00000000000..229b97601ed --- /dev/null +++ b/tooling/doc_generator/src/tests.rs @@ -0,0 +1,61 @@ +#[cfg(test)] +mod tests { + use std::collections::HashMap; + + use crate::{generate_doc, get_map, Info, Map}; + + #[test] + fn one_file() { + assert!(generate_doc("input_files/another_module.nr").is_ok()); + } + + #[test] + fn many_files() { + assert!(generate_doc("input_files/prog.nr").is_ok()); + } + + #[test] + fn impl_example() { + assert!(generate_doc("input_files/impl_example.nr").is_ok()); + } + + #[test] + fn trait_example() { + assert!(generate_doc("input_files/trait_example.nr").is_ok()); + } + + #[test] + fn struct_example() { + assert!(generate_doc("input_files/struct_example.nr").is_ok()); + } + + #[test] + fn function_output() { + let mut map = HashMap::new(); + map.insert( + Info::Function { signature: "fn main ( x : Field , y : pub Field ) ".to_string() }, + "doc comment".to_string(), + ); + + let result = Map { map }; + + assert_eq!(get_map("input_files/function_example.nr").unwrap(), result); + } + + #[test] + fn structure_output() { + let mut map = HashMap::new(); + map.insert( + Info::Struct { + signature: "struct GrumpkinScalar {\n/* private fields */\n}".to_string(), + additional_doc: "".to_string(), + implementations: vec![], + }, + "".to_string(), + ); + + let result = Map { map }; + + assert_eq!(get_map("input_files/struct_example.nr").unwrap(), result); + } +} diff --git a/tooling/doc_generator/templates/code_template.html b/tooling/doc_generator/templates/code_template.html new file mode 100644 index 00000000000..19d6f8539a7 --- /dev/null +++ b/tooling/doc_generator/templates/code_template.html @@ -0,0 +1,54 @@ + + + + Code Page + + + +
+
+ + + + + + + {% for code_line in codelines %} + + + + + {% endfor %} + +
{{ code_line.number }}{{ code_line.text }}
+
+
+ + diff --git a/tooling/doc_generator/templates/doc_template.html b/tooling/doc_generator/templates/doc_template.html new file mode 100644 index 00000000000..42ce0127a89 --- /dev/null +++ b/tooling/doc_generator/templates/doc_template.html @@ -0,0 +1,225 @@ + + + + + Main Page + + + + + + +
+
+

+ Module {{filename}} + source +

+ {% for output in all_output %} + {% if output.type == Type::OuterComment %} +

{{output.doc}}

+ {% endif %} + {% endfor %} +
+

Functions

+
+ + + + + + + {% for output in all_output %} + {% if output.type == Type::Function %} + + + + + {% endif %} + {% endfor %} + +
{{output.doc}}
+ +

Modules

+
+ + + + + + + {% for output in all_output %} + {% if output.type == Type::Module %} + + + + + {% endif %} + {% endfor %} + +
{{output.doc}}
+ +

Structs

+
+ + + + + + + {% for output in all_output %} + {% if output.type == Type::Struct %} + + + + + {% endif %} + {% endfor %} + +
{{output.doc}}
+ +

Traits

+
+ + + + + + + {% for output in all_output %} + {% if output.type == Type::Trait %} + + + + + {% endif %} + {% endfor %} + +
{{output.doc}}
+
+ + + + + + + \ No newline at end of file diff --git a/tooling/doc_generator/templates/func_template.html b/tooling/doc_generator/templates/func_template.html new file mode 100644 index 00000000000..50903c005b3 --- /dev/null +++ b/tooling/doc_generator/templates/func_template.html @@ -0,0 +1,83 @@ + + + + {{ name }} + + + +
+

+ Function {{name}} +

+
{{signature}}
+

{{ doc }}

+
+ + \ No newline at end of file diff --git a/tooling/doc_generator/templates/search_results_template.html b/tooling/doc_generator/templates/search_results_template.html new file mode 100644 index 00000000000..c0473bfe8da --- /dev/null +++ b/tooling/doc_generator/templates/search_results_template.html @@ -0,0 +1,140 @@ + + + + Search results + + + +

Search results

+
+ +
+ +
+ + + {% for result in results %} + {% if result.type == Type::Struct || + result.type == Type::Function || + result.type == Type::Trait %} + + + + + + {% endif %} + {% endfor %} + +
{{result.name}}{{result.type}}{{result.doc}}
+
+ + + + diff --git a/tooling/doc_generator/templates/struct_template.html b/tooling/doc_generator/templates/struct_template.html new file mode 100644 index 00000000000..ac2a8a90808 --- /dev/null +++ b/tooling/doc_generator/templates/struct_template.html @@ -0,0 +1,111 @@ + + + + + {{ name }} + + + + +
+

Structure {{ name }}

+
{{ signature }}
+

{{ doc }}

+
+ +
+

Documentation

+
+

{{ additional_doc }}

+
+ +
+

Implementations

+
+
    + {% for implementation in implementations %} +
  • {{ implementation.signature }}
  • +
      + {% for func in implementation.functions %} +
    • {{ func.signature }}
    • + {{ func.doc }} + {% endfor %} +
    + {% endfor %} +
+
+ + + \ No newline at end of file diff --git a/tooling/doc_generator/templates/trait_template.html b/tooling/doc_generator/templates/trait_template.html new file mode 100644 index 00000000000..b654153aa3e --- /dev/null +++ b/tooling/doc_generator/templates/trait_template.html @@ -0,0 +1,131 @@ + + + + + {{ name }} + + + +
+

Trait {{ name }}

+
{{ signature }}
+

{{ doc }}

+
+ +
+

Documentation

+
+

{{ additional_doc }}

+
+ +
+

Required methods

+
+
    + {% for method in required_methods %} +
  • {{ method.signature }}
  • + {{ method.doc }} + {% endfor %} +
+
+ +
+

Provided methods

+
+
    + {% for method in provided_methods %} +
  • {{ method.signature }}
  • + {{ method.doc }} + {% endfor %} +
+
+ +
+

Implementors

+
+
    + {% for implementation in implementations %} +
  • {{ implementation.signature }}
  • +
      + {% for func in implementation.functions %} +
    • {{ func.signature }}
    • + {% endfor %} +
    + {% endfor %} +
+
+ +