summaryrefslogtreecommitdiffstats
path: root/vendor/winnow
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/winnow
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/winnow')
-rw-r--r--vendor/winnow/.cargo-checksum.json2
-rw-r--r--vendor/winnow/Cargo.lock222
-rw-r--r--vendor/winnow/Cargo.toml21
-rw-r--r--vendor/winnow/benches/iter.rs120
-rw-r--r--vendor/winnow/src/_topic/performance.rs1
-rw-r--r--vendor/winnow/src/_topic/why.rs4
-rw-r--r--vendor/winnow/src/_tutorial/chapter_0.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_1.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_2.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_3.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_4.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_5.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_6.rs1
-rw-r--r--vendor/winnow/src/_tutorial/chapter_7.rs1
-rw-r--r--vendor/winnow/src/_tutorial/mod.rs2
-rw-r--r--vendor/winnow/src/binary/bits/mod.rs46
-rw-r--r--vendor/winnow/src/combinator/branch.rs25
-rw-r--r--vendor/winnow/src/combinator/mod.rs4
-rw-r--r--vendor/winnow/src/combinator/parser.rs25
-rw-r--r--vendor/winnow/src/combinator/tests.rs23
-rw-r--r--vendor/winnow/src/error.rs459
-rw-r--r--vendor/winnow/src/macros.rs1
-rw-r--r--vendor/winnow/src/parser.rs18
-rw-r--r--vendor/winnow/src/stream/mod.rs30
-rw-r--r--vendor/winnow/src/trace/internals.rs63
-rw-r--r--vendor/winnow/src/trace/mod.rs18
26 files changed, 907 insertions, 185 deletions
diff --git a/vendor/winnow/.cargo-checksum.json b/vendor/winnow/.cargo-checksum.json
index fdb3c99e6..9dc595f45 100644
--- a/vendor/winnow/.cargo-checksum.json
+++ b/vendor/winnow/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.lock":"7c65788ac9847ad91189d9bde88f490728377e9a1d22688c02d1432e40c92714","Cargo.toml":"e26ced242b413f24d8011cf68fed694f72efa78eb6795c6299f579e580234c7e","LICENSE-MIT":"cb5aedb296c5246d1f22e9099f925a65146f9f0d6b4eebba97fd27a6cdbbab2d","README.md":"b66d0e430d8a5f5391f1f51b2d7959c3881fca59fdf76a075129591b396c1c62","benches/contains_token.rs":"cd1ce72b8e1c92f8bd9539b1933e3337fedbc2e22f98959adb18b1a215f3cd70","benches/number.rs":"f4b54895ed523c462ce327a5205b0b99591eb7056fe9de9abe3f809eff287386","examples/arithmetic/bench.rs":"ff0220a18c6004cca8b56583072fbb7290f022cc069f2d24be132f261ac55f18","examples/arithmetic/main.rs":"aab0793c96add893bbaacea331bc05de8f6b59e47c5bccca67bfd30e924cd790","examples/arithmetic/parser.rs":"ddb86007e2c6be97acd08788f30a13083e0615bf5314a625d74e6a72d69da43f","examples/arithmetic/parser_ast.rs":"748d238fac2fe83b6ab9dfad5d6a2bb5f1863f6c2a2757e17271053291da3990","examples/css/main.rs":"3127f259af57aaaa8363bfa6e0a64c9719173cc1dcc5a293771a2c8a7f31982e","examples/css/parser.rs":"7175cfdc36d228b3130f0cfc8565063554167998045a07f62644bbd90c2772b2","examples/custom_error.rs":"5ebf88007ed2ce998fdb16cd4326b1573e83f0c420e2f6561c10b6dd8ebf69a2","examples/http/bench.rs":"b6d3e9e5833b53ac58f8336617cc42a2f3f4c5e5ce88feb23184fcdbb36843f6","examples/http/main.rs":"95d3c73953cd76ea462d886ade2ab34e987239bae3abb0349c434fb01b80467d","examples/http/parser.rs":"55a5894ab8e211a17f2eb9db72503579704d85376a6631a741eede2bfcd4bdbd","examples/http/parser_streaming.rs":"1300486af4dfcfe9b1b396436ef58927663624b0184b9c70a636e639c09c4552","examples/ini/bench.rs":"c8fd1aed25ce2878c0f440d765779d7877e83ca202cf071f8f4c57566596bf89","examples/ini/main.rs":"d771aa8aae11e53f4f5453ac39e10ae3a1de210408dfd31ca7d1ce58d14c3fb9","examples/ini/parser.rs":"c554286e8f2077f999d607902e7a63ce3945939118bccf830a68b22bfe24c775","examples/ini/parser_str.rs":"8f5bce75153ae98d5e76f884fec4746a73c44c4fb9a3c4c2efdf77913baf3bec","examples/iterator.rs":"21fb0480749116407689162f0d3e9957e3e7b6863f9dda08ee01af675409b06e","examples/json/bench.rs":"9479248ccef46e0741e0eebf9fb3b307b343ba665925481adc4554d8e65f9d39","examples/json/json.rs":"48cf6c114098113c9767bebe430682f55f7c1a227e6486131ca58c00770711f2","examples/json/main.rs":"7ab1f6eefd4eb61153cf05991e593fd10827ac09f66af45d3019f94c39c5b84e","examples/json/parser.rs":"6a49d300a323bfab9deb9221c92c44ea4b5738788077f712cc8d12d082583127","examples/json/parser_dispatch.rs":"370ae21b2c1f9fe848a8ca0d9f821109ab0995c78575d01a0abe32715429eb41","examples/json/parser_partial.rs":"4f944c45223161fcbb6025fb8e71306e549ab39bf62d26bcbf85c61d124b18e2","examples/json_iterator.rs":"070f7ade176b04b70b026b1915601a52fbb462ec0cc7b9d6684d1e0a04c2d031","examples/ndjson/example.ndjson":"c44c130731008bca76181348d40f46b183577949b5a4d229e0e1a56e1e405e5d","examples/ndjson/main.rs":"dc92dd5d76b5d43edf947b6455d552f0212e46d59c926d95f97f5d159b14e361","examples/ndjson/parser.rs":"e10c0940da97def0a9c628916433cb867ea1a8cc6ecc0dff58bc98d13ec47ccd","examples/s_expression/main.rs":"5a2de0b477807c7d6ab8bb72579f03692e8f5ea89d5b6f3a8342cfdbe4d84b96","examples/s_expression/parser.rs":"a98fa7a2230d3c2aa77206bed66d7c4167707464bdb790f2ab25d803813589e3","examples/string/main.rs":"e6362f957d532d41bcd96476e55ac4c253eb04fa25ee88b48d872661a46a5bb5","examples/string/parser.rs":"111c8b67d9e51eef8b980f4efb9264d76598cb09e820b74f9ea8dfec5176abb4","src/_topic/arithmetic.rs":"94920a9572ed6deac58abb337a7be57b93cf37440f0cc3eaf514cb9ad9b9e077","src/_topic/error.rs":"69c972c609a91e078ddb4e01da8f3d35f29d8dbcb077614e9b156c033c9f5dd7","src/_topic/fromstr.rs":"01abdab296cd30067ae5f508b2b21ebe97c0571ace58e7817876eb2110e8d23a","src/_topic/http.rs":"19b9ec78a031fe5b3086fb34d04d6c13308c50b6e7bfe30229f5b682d3605ac8","src/_topic/ini.rs":"b2b04d48eac3158f4e26ee9dce748a699d02acaa0b12ae8d54421cad0fdc4ad7","src/_topic/json.rs":"bde39ee6b1c5fab2d2da480822b737674aed877f92c3f748d6932bec313b5661","src/_topic/language.rs":"437814054d4a0a19ffccd74ff9189677e6a8e9df45dc395861fc75d5bd23719b","src/_topic/mod.rs":"7e871bc9f8838ab2b7bf35db6800e17a19bf8132675e305087cb6dd1e841cbec","src/_topic/partial.rs":"5b795d1a8f2fa5a378c4974f9862acd479392a645b93c5dc4da2c4b1384c0d0d","src/_topic/performance.rs":"4e3f606e979c2bc0df78a3e706ccae2b844918eceb955ecd9c8b81ce27e660e3","src/_topic/s_expression.rs":"6ca9a22a5c3344e120421f2ab353a1e822777aebfa1faa0acffc9632f7668cb2","src/_topic/stream.rs":"5ae58b8a53e7ffe60df4fbe862fbc2319f5c36f798767b7b650dd6441332042b","src/_topic/why.rs":"5b425ff59f5bb0bbab87e63e4126161819a209fd9b316288ed3c58084012e5d7","src/_tutorial/chapter_0.rs":"2dd082fa014e8075e13524ce6a9ecf29adc380518764c487729d46e45463dc03","src/_tutorial/chapter_1.rs":"ba83c8b7cf964314414b0e8f7bd500b1931a974bee48e3e78e9c4f96626983e8","src/_tutorial/chapter_2.rs":"e2bc77fe8a122ea1f53f77501d0fa73ffc6e9c050a402e4266950b124e05edba","src/_tutorial/chapter_3.rs":"c7264e2fac45255c5a1b5c891cdcbffff840ee723f254f3e8556d4b794c438cd","src/_tutorial/chapter_4.rs":"d3a937b7305eea326cb16c0cf7b0033866693af6f5aa6ff05d073c0be9c71a73","src/_tutorial/chapter_5.rs":"f1eb8a17f1b5d35be3f9f2f24838ad5057791538440079fa95c3c665909cf8e0","src/_tutorial/chapter_6.rs":"2deec40067e1d5cef944d3773adaa0fcd17746abbcd489de6fadd874d45a9af7","src/_tutorial/chapter_7.rs":"fd8bac691a830bf49b56ddbcf4df64ba3eaef5d67740862d00e0741b590596ed","src/_tutorial/mod.rs":"b69bb758ffcfbc1fa0c698ffc11d840ea6de3f8fa402ef8e170f3a0d6c3e190a","src/ascii/mod.rs":"9891ba592aa3a1ca188a2da3e1fb0bccf85b670f5a0a2cd154b546fa12e4a1e7","src/ascii/tests.rs":"cbd0d7db9eb795762de305fde5204ee70396cb384ac7826bde91bf9c69cbec74","src/binary/bits/mod.rs":"35e9fa4c97dd1dbbe99434a15ee81773c18744f847c7d5c1435cf67c88dd946f","src/binary/bits/tests.rs":"1ce1707a8ab2300d601f67fb3cb9c4b8ba7528564477e65ff25d8542c3e0f6e7","src/binary/mod.rs":"6447ddb0d1f87ee653c4cc629fbc60714228d236fb6dad68ff0994df2c239d84","src/binary/tests.rs":"bc8c383d345e9d63f09d3edb6e4ff76b8e6d422f2359f7e7b2b29c56082d3b93","src/combinator/branch.rs":"4111b409191755a6fd94c1cbd3b9d6ed9f955a2f04cfa2d316106cd55612f9b6","src/combinator/core.rs":"632201f917e732b80c8dbe88c43f33e868df5261449b22b18e60424a795e0f45","src/combinator/mod.rs":"03d3864d577c615b89d0266877090ee67422f83301ee130833c5dff8ff88767e","src/combinator/multi.rs":"7a7acdbb667617627c1af7fb601bf1ec48df589e89744023ea32ce0eff1e4eaa","src/combinator/parser.rs":"cb7761454ec3b874b2434e3b9cbc89232cd9b7e8c8f6c1c71c0a3ef12fa28809","src/combinator/sequence.rs":"f913aec935bbdb1fd496e76dbc14d697d8e7e48c163856e062c5ded2f3170905","src/combinator/tests.rs":"9e9765024fa58adb3455bfc3815b923c3f93acf123ab1ef3a22d5ee832e50a7c","src/error.rs":"2b4f4bf06b93832e00c0a1ea9297a5214a4adcca270861803707d4f7d608712a","src/lib.rs":"3436ea3a7ca6375c49a62c674ad348b3601eb5d969b7376aeb19d395a24d2c63","src/macros.rs":"321af97e0315ca11164064cadbca2a8c0a55bcf605d101d5a6a4f4bca66eedf6","src/parser.rs":"eedb8942ec451ca0c28780edee543f5db93306d3c1c6b04d2d054a24c934ce2c","src/stream/impls.rs":"99f69fdb8c32ad1f759bcc414ebfd2428eac5997887ce2b6946a2fcfcd174082","src/stream/mod.rs":"491eb5efec578cddc694f1a2c8f96a74329bd8d2b976d596c6c006fa0a301348","src/stream/tests.rs":"e351ea68ba3fbeaeeac147ac7c186d8ee3a17ff09c78c016dd294eb0719d54f2","src/token/mod.rs":"99689541315f795e57983566aab3c641ccf711492a2e397af15213a63b6cb702","src/token/tests.rs":"65819246fac1c10abe4abeeb79e30fb03b06a9a5ef6fde3edec003ad1f034f78","src/trace/internals.rs":"725fd32f904fee0b61188e816bd42da3d42ffff43cbb4077d9324acfd96fd409","src/trace/mod.rs":"c63934ae83d80f6d6c1be0b6960fb107d67f42c1fdca8a1d680f999cd74c4b5d"},"package":"81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7"} \ No newline at end of file
+{"files":{"Cargo.lock":"fbba351eeeef7391bab2512e3078a5dfe5be94742eef876eacbbd70d3b901769","Cargo.toml":"77ca17f5cffc130edd52c3894d0f23947c3b08e6bec4b1a9ab8b0b7d6973b979","LICENSE-MIT":"cb5aedb296c5246d1f22e9099f925a65146f9f0d6b4eebba97fd27a6cdbbab2d","README.md":"b66d0e430d8a5f5391f1f51b2d7959c3881fca59fdf76a075129591b396c1c62","benches/contains_token.rs":"cd1ce72b8e1c92f8bd9539b1933e3337fedbc2e22f98959adb18b1a215f3cd70","benches/iter.rs":"bede3f156b87ffb8b901b092bcbb2717b7adf9a461a2fecdfad86025aad3e587","benches/number.rs":"f4b54895ed523c462ce327a5205b0b99591eb7056fe9de9abe3f809eff287386","examples/arithmetic/bench.rs":"ff0220a18c6004cca8b56583072fbb7290f022cc069f2d24be132f261ac55f18","examples/arithmetic/main.rs":"aab0793c96add893bbaacea331bc05de8f6b59e47c5bccca67bfd30e924cd790","examples/arithmetic/parser.rs":"ddb86007e2c6be97acd08788f30a13083e0615bf5314a625d74e6a72d69da43f","examples/arithmetic/parser_ast.rs":"748d238fac2fe83b6ab9dfad5d6a2bb5f1863f6c2a2757e17271053291da3990","examples/css/main.rs":"3127f259af57aaaa8363bfa6e0a64c9719173cc1dcc5a293771a2c8a7f31982e","examples/css/parser.rs":"7175cfdc36d228b3130f0cfc8565063554167998045a07f62644bbd90c2772b2","examples/custom_error.rs":"5ebf88007ed2ce998fdb16cd4326b1573e83f0c420e2f6561c10b6dd8ebf69a2","examples/http/bench.rs":"b6d3e9e5833b53ac58f8336617cc42a2f3f4c5e5ce88feb23184fcdbb36843f6","examples/http/main.rs":"95d3c73953cd76ea462d886ade2ab34e987239bae3abb0349c434fb01b80467d","examples/http/parser.rs":"55a5894ab8e211a17f2eb9db72503579704d85376a6631a741eede2bfcd4bdbd","examples/http/parser_streaming.rs":"1300486af4dfcfe9b1b396436ef58927663624b0184b9c70a636e639c09c4552","examples/ini/bench.rs":"c8fd1aed25ce2878c0f440d765779d7877e83ca202cf071f8f4c57566596bf89","examples/ini/main.rs":"d771aa8aae11e53f4f5453ac39e10ae3a1de210408dfd31ca7d1ce58d14c3fb9","examples/ini/parser.rs":"c554286e8f2077f999d607902e7a63ce3945939118bccf830a68b22bfe24c775","examples/ini/parser_str.rs":"8f5bce75153ae98d5e76f884fec4746a73c44c4fb9a3c4c2efdf77913baf3bec","examples/iterator.rs":"21fb0480749116407689162f0d3e9957e3e7b6863f9dda08ee01af675409b06e","examples/json/bench.rs":"9479248ccef46e0741e0eebf9fb3b307b343ba665925481adc4554d8e65f9d39","examples/json/json.rs":"48cf6c114098113c9767bebe430682f55f7c1a227e6486131ca58c00770711f2","examples/json/main.rs":"7ab1f6eefd4eb61153cf05991e593fd10827ac09f66af45d3019f94c39c5b84e","examples/json/parser.rs":"6a49d300a323bfab9deb9221c92c44ea4b5738788077f712cc8d12d082583127","examples/json/parser_dispatch.rs":"370ae21b2c1f9fe848a8ca0d9f821109ab0995c78575d01a0abe32715429eb41","examples/json/parser_partial.rs":"4f944c45223161fcbb6025fb8e71306e549ab39bf62d26bcbf85c61d124b18e2","examples/json_iterator.rs":"070f7ade176b04b70b026b1915601a52fbb462ec0cc7b9d6684d1e0a04c2d031","examples/ndjson/example.ndjson":"c44c130731008bca76181348d40f46b183577949b5a4d229e0e1a56e1e405e5d","examples/ndjson/main.rs":"dc92dd5d76b5d43edf947b6455d552f0212e46d59c926d95f97f5d159b14e361","examples/ndjson/parser.rs":"e10c0940da97def0a9c628916433cb867ea1a8cc6ecc0dff58bc98d13ec47ccd","examples/s_expression/main.rs":"5a2de0b477807c7d6ab8bb72579f03692e8f5ea89d5b6f3a8342cfdbe4d84b96","examples/s_expression/parser.rs":"a98fa7a2230d3c2aa77206bed66d7c4167707464bdb790f2ab25d803813589e3","examples/string/main.rs":"e6362f957d532d41bcd96476e55ac4c253eb04fa25ee88b48d872661a46a5bb5","examples/string/parser.rs":"111c8b67d9e51eef8b980f4efb9264d76598cb09e820b74f9ea8dfec5176abb4","src/_topic/arithmetic.rs":"94920a9572ed6deac58abb337a7be57b93cf37440f0cc3eaf514cb9ad9b9e077","src/_topic/error.rs":"69c972c609a91e078ddb4e01da8f3d35f29d8dbcb077614e9b156c033c9f5dd7","src/_topic/fromstr.rs":"01abdab296cd30067ae5f508b2b21ebe97c0571ace58e7817876eb2110e8d23a","src/_topic/http.rs":"19b9ec78a031fe5b3086fb34d04d6c13308c50b6e7bfe30229f5b682d3605ac8","src/_topic/ini.rs":"b2b04d48eac3158f4e26ee9dce748a699d02acaa0b12ae8d54421cad0fdc4ad7","src/_topic/json.rs":"bde39ee6b1c5fab2d2da480822b737674aed877f92c3f748d6932bec313b5661","src/_topic/language.rs":"437814054d4a0a19ffccd74ff9189677e6a8e9df45dc395861fc75d5bd23719b","src/_topic/mod.rs":"7e871bc9f8838ab2b7bf35db6800e17a19bf8132675e305087cb6dd1e841cbec","src/_topic/partial.rs":"5b795d1a8f2fa5a378c4974f9862acd479392a645b93c5dc4da2c4b1384c0d0d","src/_topic/performance.rs":"1f2f56fb70a70d5f8890deea25fa6a5df9a97d489380db0e0cf84eaa1b7806df","src/_topic/s_expression.rs":"6ca9a22a5c3344e120421f2ab353a1e822777aebfa1faa0acffc9632f7668cb2","src/_topic/stream.rs":"5ae58b8a53e7ffe60df4fbe862fbc2319f5c36f798767b7b650dd6441332042b","src/_topic/why.rs":"7805a9f27b64d253982b32ecf16963f2acc092f507da929766db5e4a554feaed","src/_tutorial/chapter_0.rs":"a86301c783ff7f3f5d7a870963fc9557347c1e1819b5acae04cc70510ada4d0d","src/_tutorial/chapter_1.rs":"c42f66bb480862dd5e46b5a992529ec354befd54aa167c24291a2e63d4f20631","src/_tutorial/chapter_2.rs":"402335520bc1303de310a0f60729816f1899af9613457676b723ad1940dfe9c3","src/_tutorial/chapter_3.rs":"8e9eca4a742c86da8edc084b873ef915acd5f97ee32e13ea1eaa0b93c90734ad","src/_tutorial/chapter_4.rs":"15d19c9ebb53f7a4ad7effb49a086be60b0bbe210d3aa65d161edf83c13d3608","src/_tutorial/chapter_5.rs":"bdf668e5121b5c8d7c4658d5d8360781cc93279f451a5e00b6c3d0cf8c3634a1","src/_tutorial/chapter_6.rs":"0ade4cfdab6f01e2f7c20be273ce6379728a2f4ee6f855fb29f8c2efc391d030","src/_tutorial/chapter_7.rs":"0767623ca13b97ab32df54c3d0b1d58c55b97d7aad25259687bdc59bf62cfef4","src/_tutorial/mod.rs":"69dc414df5be09f176c36ecee72605203c3aaa1bde77b55af012d9fd8c57a789","src/ascii/mod.rs":"9891ba592aa3a1ca188a2da3e1fb0bccf85b670f5a0a2cd154b546fa12e4a1e7","src/ascii/tests.rs":"cbd0d7db9eb795762de305fde5204ee70396cb384ac7826bde91bf9c69cbec74","src/binary/bits/mod.rs":"104b9f4435369c83f3def181eeb2a4bd8795a49738453013732ed49aebf3076a","src/binary/bits/tests.rs":"1ce1707a8ab2300d601f67fb3cb9c4b8ba7528564477e65ff25d8542c3e0f6e7","src/binary/mod.rs":"6447ddb0d1f87ee653c4cc629fbc60714228d236fb6dad68ff0994df2c239d84","src/binary/tests.rs":"bc8c383d345e9d63f09d3edb6e4ff76b8e6d422f2359f7e7b2b29c56082d3b93","src/combinator/branch.rs":"49714533de587e11a9a3dbd7a8d86a554b76681bf0911ea6f8f98e9181607995","src/combinator/core.rs":"632201f917e732b80c8dbe88c43f33e868df5261449b22b18e60424a795e0f45","src/combinator/mod.rs":"a3eb82c52c4b707a84d60c6d9da85da76b3a9004b1d5f0e0029844d45143322c","src/combinator/multi.rs":"7a7acdbb667617627c1af7fb601bf1ec48df589e89744023ea32ce0eff1e4eaa","src/combinator/parser.rs":"1ee72502cf05c476aa77ef20744abe2bf1ea9d04504cf6d13a3f9f91d2c78cf5","src/combinator/sequence.rs":"f913aec935bbdb1fd496e76dbc14d697d8e7e48c163856e062c5ded2f3170905","src/combinator/tests.rs":"b404f2047e717e073a8a45cf33db996ef69df8759ab14e9aa8d32613d0cd3beb","src/error.rs":"2ab9bdbca725625c6d2dad0b277127cd88e16c9137c2f8a3cc6e09f273fba04e","src/lib.rs":"3436ea3a7ca6375c49a62c674ad348b3601eb5d969b7376aeb19d395a24d2c63","src/macros.rs":"401a510f19ee4acc180c8dc1fd3c0a0c0e7bc50d69ffc4a925439e88f3299547","src/parser.rs":"1299d12c3facbbfb0336c53412b5c14d1dca6708e83ba847383b969bad6a24d9","src/stream/impls.rs":"99f69fdb8c32ad1f759bcc414ebfd2428eac5997887ce2b6946a2fcfcd174082","src/stream/mod.rs":"ff2cd9b3e145c029f3a1d348d0559c747516584301624e3d18b4b4790bcd8359","src/stream/tests.rs":"e351ea68ba3fbeaeeac147ac7c186d8ee3a17ff09c78c016dd294eb0719d54f2","src/token/mod.rs":"99689541315f795e57983566aab3c641ccf711492a2e397af15213a63b6cb702","src/token/tests.rs":"65819246fac1c10abe4abeeb79e30fb03b06a9a5ef6fde3edec003ad1f034f78","src/trace/internals.rs":"3480e946ba22390ac84046487728fd89d78cb3bc5547305162ed925e2437802f","src/trace/mod.rs":"7614deec7a51082464ae6ff99302bf9d8d1b11d4c6d509254cae045a913c1571"},"package":"7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc"} \ No newline at end of file
diff --git a/vendor/winnow/Cargo.lock b/vendor/winnow/Cargo.lock
index 660b2f4b7..2e2dfe5de 100644
--- a/vendor/winnow/Cargo.lock
+++ b/vendor/winnow/Cargo.lock
@@ -3,15 +3,21 @@
version = 3
[[package]]
+name = "anes"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
+
+[[package]]
name = "anstream"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163"
dependencies = [
- "anstyle 1.0.1",
- "anstyle-parse 0.2.1",
+ "anstyle",
+ "anstyle-parse",
"anstyle-query",
- "anstyle-wincon 1.0.1",
+ "anstyle-wincon",
"colorchoice",
"is-terminal",
"utf8parse",
@@ -19,27 +25,12 @@ dependencies = [
[[package]]
name = "anstyle"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2"
-
-[[package]]
-name = "anstyle"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
[[package]]
name = "anstyle-parse"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116"
-dependencies = [
- "utf8parse",
-]
-
-[[package]]
-name = "anstyle-parse"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333"
@@ -57,37 +48,12 @@ dependencies = [
]
[[package]]
-name = "anstyle-stream"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1383966ba5bad155fe30bb239f7ca9eb149990674414aee2f8aef35a0a2dc9d0"
-dependencies = [
- "anstyle 0.3.5",
- "anstyle-parse 0.1.1",
- "anstyle-wincon 0.2.0",
- "concolor-override",
- "concolor-query",
- "is-terminal",
- "utf8parse",
-]
-
-[[package]]
-name = "anstyle-wincon"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa"
-dependencies = [
- "anstyle 0.3.5",
- "windows-sys 0.45.0",
-]
-
-[[package]]
name = "anstyle-wincon"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
dependencies = [
- "anstyle 1.0.1",
+ "anstyle",
"windows-sys 0.48.0",
]
@@ -130,6 +96,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
+name = "bitflags"
+version = "2.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
+
+[[package]]
name = "block-buffer"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -175,6 +147,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
+name = "ciborium"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926"
+dependencies = [
+ "ciborium-io",
+ "ciborium-ll",
+ "serde",
+]
+
+[[package]]
+name = "ciborium-io"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656"
+
+[[package]]
+name = "ciborium-ll"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b"
+dependencies = [
+ "ciborium-io",
+ "half",
+]
+
+[[package]]
name = "circular"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -182,35 +181,34 @@ checksum = "b0fc239e0f6cb375d2402d48afb92f76f5404fd1df208a41930ec81eda078bea"
[[package]]
name = "clap"
-version = "2.34.0"
+version = "4.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
+checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d"
dependencies = [
- "bitflags",
- "textwrap",
- "unicode-width",
+ "clap_builder",
]
[[package]]
-name = "colorchoice"
-version = "1.0.0"
+name = "clap_builder"
+version = "4.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
+checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1"
+dependencies = [
+ "anstyle",
+ "clap_lex",
+]
[[package]]
-name = "concolor-override"
-version = "1.0.0"
+name = "clap_lex"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f"
+checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
[[package]]
-name = "concolor-query"
-version = "0.3.3"
+name = "colorchoice"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf"
-dependencies = [
- "windows-sys 0.45.0",
-]
+checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "cpufeatures"
@@ -223,24 +221,24 @@ dependencies = [
[[package]]
name = "criterion"
-version = "0.3.6"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f"
+checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"
dependencies = [
- "atty",
+ "anes",
"cast",
+ "ciborium",
"clap",
"criterion-plot",
- "csv",
+ "is-terminal",
"itertools",
- "lazy_static",
"num-traits",
+ "once_cell",
"oorandom",
"plotters",
"rayon",
"regex",
"serde",
- "serde_cbor",
"serde_derive",
"serde_json",
"tinytemplate",
@@ -249,9 +247,9 @@ dependencies = [
[[package]]
name = "criterion-plot"
-version = "0.4.5"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876"
+checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"
dependencies = [
"cast",
"itertools",
@@ -311,27 +309,6 @@ dependencies = [
]
[[package]]
-name = "csv"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086"
-dependencies = [
- "csv-core",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "csv-core"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
-dependencies = [
- "memchr",
-]
-
-[[package]]
name = "ctor"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -504,13 +481,12 @@ dependencies = [
[[package]]
name = "is-terminal"
-version = "0.4.7"
+version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"
+checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
"hermit-abi 0.3.1",
- "io-lifetimes",
- "rustix",
+ "rustix 0.38.6",
"windows-sys 0.48.0",
]
@@ -569,6 +545,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
+name = "linux-raw-sys"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503"
+
+[[package]]
name = "log"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -752,7 +734,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65"
dependencies = [
"bit-set",
- "bitflags",
+ "bitflags 1.3.2",
"byteorder",
"lazy_static",
"num-traits",
@@ -856,7 +838,7 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
]
[[package]]
@@ -886,11 +868,24 @@ version = "0.37.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
"errno",
"io-lifetimes",
"libc",
- "linux-raw-sys",
+ "linux-raw-sys 0.3.8",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "rustix"
+version = "0.38.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f"
+dependencies = [
+ "bitflags 2.3.3",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.4.5",
"windows-sys 0.48.0",
]
@@ -937,16 +932,6 @@ dependencies = [
]
[[package]]
-name = "serde_cbor"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
-dependencies = [
- "half",
- "serde",
-]
-
-[[package]]
name = "serde_derive"
version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -992,7 +977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6bccd62078347f89a914e3004d94582e13824d4e3d8a816317862884c423835"
dependencies = [
"anstream",
- "anstyle 1.0.1",
+ "anstyle",
"escargot",
"normalize-line-endings",
"similar",
@@ -1040,7 +1025,7 @@ dependencies = [
"cfg-if",
"fastrand",
"redox_syscall",
- "rustix",
+ "rustix 0.37.20",
"windows-sys 0.48.0",
]
@@ -1076,20 +1061,11 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237"
dependencies = [
- "rustix",
+ "rustix 0.37.20",
"windows-sys 0.48.0",
]
[[package]]
-name = "textwrap"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
name = "thiserror"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1415,10 +1391,10 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winnow"
-version = "0.5.0"
+version = "0.5.15"
dependencies = [
- "anstyle 0.3.5",
- "anstyle-stream",
+ "anstream",
+ "anstyle",
"circular",
"criterion",
"doc-comment",
diff --git a/vendor/winnow/Cargo.toml b/vendor/winnow/Cargo.toml
index 760878da4..a44df6680 100644
--- a/vendor/winnow/Cargo.toml
+++ b/vendor/winnow/Cargo.toml
@@ -13,11 +13,12 @@
edition = "2021"
rust-version = "1.64.0"
name = "winnow"
-version = "0.5.0"
+version = "0.5.15"
include = [
"build.rs",
"src/**/*",
"Cargo.toml",
+ "Cargo.lock",
"LICENSE*",
"README.md",
"benches/**/*",
@@ -147,6 +148,10 @@ name = "contains_token"
harness = false
[[bench]]
+name = "iter"
+harness = false
+
+[[bench]]
name = "number"
harness = false
@@ -168,16 +173,16 @@ path = "examples/json/bench.rs"
harness = false
required-features = ["std"]
-[dependencies.anstyle]
-version = "0.3.5"
+[dependencies.anstream]
+version = "0.3.2"
optional = true
-[dependencies.anstyle-stream]
-version = "0.2.2"
+[dependencies.anstyle]
+version = "1.0.1"
optional = true
[dependencies.is-terminal]
-version = "0.4.7"
+version = "0.4.9"
optional = true
[dependencies.memchr]
@@ -193,7 +198,7 @@ optional = true
version = "0.3.0"
[dev-dependencies.criterion]
-version = "0.3.6"
+version = "0.5.1"
[dev-dependencies.doc-comment]
version = "0.3"
@@ -217,10 +222,10 @@ version = "0.2.0"
[features]
alloc = []
debug = [
+ "dep:anstream",
"dep:anstyle",
"dep:is-terminal",
"dep:terminal_size",
- "dep:anstyle-stream",
]
default = ["std"]
simd = ["dep:memchr"]
diff --git a/vendor/winnow/benches/iter.rs b/vendor/winnow/benches/iter.rs
new file mode 100644
index 000000000..0a0d5ff3d
--- /dev/null
+++ b/vendor/winnow/benches/iter.rs
@@ -0,0 +1,120 @@
+use criterion::black_box;
+
+use winnow::combinator::opt;
+use winnow::prelude::*;
+use winnow::stream::AsChar;
+use winnow::stream::Stream as _;
+use winnow::token::one_of;
+
+fn iter(c: &mut criterion::Criterion) {
+ let data = [
+ ("contiguous", CONTIGUOUS.as_bytes()),
+ ("interleaved", INTERLEAVED.as_bytes()),
+ ("canada", CANADA.as_bytes()),
+ ];
+ let mut group = c.benchmark_group("iter");
+ for (name, sample) in data {
+ let len = sample.len();
+ group.throughput(criterion::Throughput::Bytes(len as u64));
+
+ group.bench_with_input(
+ criterion::BenchmarkId::new("iterate", name),
+ &len,
+ |b, _| {
+ b.iter(|| black_box(iterate.parse_peek(black_box(sample)).unwrap()));
+ },
+ );
+ group.bench_with_input(
+ criterion::BenchmarkId::new("next_token", name),
+ &len,
+ |b, _| {
+ b.iter(|| black_box(next_token.parse_peek(black_box(sample)).unwrap()));
+ },
+ );
+ group.bench_with_input(
+ criterion::BenchmarkId::new("opt(one_of)", name),
+ &len,
+ |b, _| {
+ b.iter(|| black_box(opt_one_of.parse_peek(black_box(sample)).unwrap()));
+ },
+ );
+ group.bench_with_input(
+ criterion::BenchmarkId::new("take_while", name),
+ &len,
+ |b, _| {
+ b.iter(|| black_box(take_while.parse_peek(black_box(sample)).unwrap()));
+ },
+ );
+ group.bench_with_input(criterion::BenchmarkId::new("repeat", name), &len, |b, _| {
+ b.iter(|| black_box(repeat.parse_peek(black_box(sample)).unwrap()));
+ });
+ }
+ group.finish();
+}
+
+fn iterate(input: &mut &[u8]) -> PResult<usize> {
+ let mut count = 0;
+ for byte in input.iter() {
+ if byte.is_dec_digit() {
+ count += 1;
+ }
+ }
+ input.finish();
+ Ok(count)
+}
+
+fn next_token(input: &mut &[u8]) -> PResult<usize> {
+ let mut count = 0;
+ while let Some(byte) = input.next_token() {
+ if byte.is_dec_digit() {
+ count += 1;
+ }
+ }
+ Ok(count)
+}
+
+fn opt_one_of(input: &mut &[u8]) -> PResult<usize> {
+ let mut count = 0;
+ while !input.is_empty() {
+ while opt(one_of(AsChar::is_dec_digit))
+ .parse_next(input)?
+ .is_some()
+ {
+ count += 1;
+ }
+ while opt(one_of(|b: u8| !b.is_dec_digit()))
+ .parse_next(input)?
+ .is_some()
+ {}
+ }
+ Ok(count)
+}
+
+fn take_while(input: &mut &[u8]) -> PResult<usize> {
+ let mut count = 0;
+ while !input.is_empty() {
+ count += winnow::token::take_while(0.., AsChar::is_dec_digit)
+ .parse_next(input)?
+ .len();
+ let _ = winnow::token::take_while(0.., |b: u8| !b.is_dec_digit()).parse_next(input)?;
+ }
+ Ok(count)
+}
+
+fn repeat(input: &mut &[u8]) -> PResult<usize> {
+ let mut count = 0;
+ while !input.is_empty() {
+ count += winnow::combinator::repeat(0.., one_of(AsChar::is_dec_digit))
+ .map(|count: usize| count)
+ .parse_next(input)?;
+ winnow::combinator::repeat(0.., one_of(|b: u8| !b.is_dec_digit())).parse_next(input)?;
+ }
+ Ok(count)
+}
+
+const CONTIGUOUS: &str = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
+const INTERLEAVED: &str = "0123456789abc0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab0123456789ab";
+const CANADA: &str = include_str!("../third_party/nativejson-benchmark/data/canada.json");
+
+criterion::criterion_group!(benches, iter);
+criterion::criterion_main!(benches);
diff --git a/vendor/winnow/src/_topic/performance.rs b/vendor/winnow/src/_topic/performance.rs
index 5bda958ee..8a6555a06 100644
--- a/vendor/winnow/src/_topic/performance.rs
+++ b/vendor/winnow/src/_topic/performance.rs
@@ -5,6 +5,7 @@
//! See also the general Rust [Performance Book](https://nnethercote.github.io/perf-book/)
//!
//! Tips
+//! - Try `cargo add winnow -F simd`. For some it offers significant performance improvements
//! - When enough cases of an [`alt`] have unique prefixes, prefer [`dispatch`]
//! - When parsing text, try to parse as bytes (`u8`) rather than `char`s ([`BStr`] can make
//! debugging easier)
diff --git a/vendor/winnow/src/_topic/why.rs b/vendor/winnow/src/_topic/why.rs
index e28181b1a..e0328f117 100644
--- a/vendor/winnow/src/_topic/why.rs
+++ b/vendor/winnow/src/_topic/why.rs
@@ -16,7 +16,7 @@
//! - Fewer dependencies to audit
//!
//! However, this comes at the cost of doing it all yourself, including
-//! - Optimizing for each of the above characteristics you are about
+//! - Optimizing for each of the above characteristics you care about
//! - Ensuring the safety of any `unsafe` code (buffer overflows being a common bug with parsers)
//! - Being aware of, familiar with, and correctly implement the relevant algorithms.
//! matklad, who has written two rust compile frontends, commented
@@ -52,7 +52,7 @@
//!
//! This works well for:
//! - Prototyping for what will be a hand-written parser
-//! - When you to minimize the work to evolve your format
+//! - When you want to minimize the work to evolve your format
//! - When you don't have contributors focused solely on parsing and your grammar is large enough
//! to be unwieldy to hand write.
//!
diff --git a/vendor/winnow/src/_tutorial/chapter_0.rs b/vendor/winnow/src/_tutorial/chapter_0.rs
index 4c768d8f8..47c196e86 100644
--- a/vendor/winnow/src/_tutorial/chapter_0.rs
+++ b/vendor/winnow/src/_tutorial/chapter_0.rs
@@ -36,3 +36,4 @@ use crate::_topic;
use std::iter::Iterator;
pub use super::chapter_1 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_1.rs b/vendor/winnow/src/_tutorial/chapter_1.rs
index 1bf146bec..b16a16657 100644
--- a/vendor/winnow/src/_tutorial/chapter_1.rs
+++ b/vendor/winnow/src/_tutorial/chapter_1.rs
@@ -83,3 +83,4 @@ use crate::Parser;
pub use super::chapter_0 as previous;
pub use super::chapter_2 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_2.rs b/vendor/winnow/src/_tutorial/chapter_2.rs
index b0daedc74..0fb80ac37 100644
--- a/vendor/winnow/src/_tutorial/chapter_2.rs
+++ b/vendor/winnow/src/_tutorial/chapter_2.rs
@@ -245,3 +245,4 @@ use std::ops::RangeInclusive;
pub use super::chapter_1 as previous;
pub use super::chapter_3 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_3.rs b/vendor/winnow/src/_tutorial/chapter_3.rs
index 83714f4d7..4dfdc31e4 100644
--- a/vendor/winnow/src/_tutorial/chapter_3.rs
+++ b/vendor/winnow/src/_tutorial/chapter_3.rs
@@ -373,3 +373,4 @@ use crate::stream::Stream;
pub use super::chapter_2 as previous;
pub use super::chapter_4 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_4.rs b/vendor/winnow/src/_tutorial/chapter_4.rs
index fb14613f3..59aa7ee87 100644
--- a/vendor/winnow/src/_tutorial/chapter_4.rs
+++ b/vendor/winnow/src/_tutorial/chapter_4.rs
@@ -107,3 +107,4 @@ use std::str::FromStr;
pub use super::chapter_3 as previous;
pub use super::chapter_5 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_5.rs b/vendor/winnow/src/_tutorial/chapter_5.rs
index 95a89dc8c..ffd8a29ce 100644
--- a/vendor/winnow/src/_tutorial/chapter_5.rs
+++ b/vendor/winnow/src/_tutorial/chapter_5.rs
@@ -279,3 +279,4 @@ use std::vec::Vec;
pub use super::chapter_4 as previous;
pub use super::chapter_6 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_6.rs b/vendor/winnow/src/_tutorial/chapter_6.rs
index d7d2c9fc8..9f4230942 100644
--- a/vendor/winnow/src/_tutorial/chapter_6.rs
+++ b/vendor/winnow/src/_tutorial/chapter_6.rs
@@ -153,3 +153,4 @@ use crate::_topic;
pub use super::chapter_5 as previous;
pub use super::chapter_7 as next;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/chapter_7.rs b/vendor/winnow/src/_tutorial/chapter_7.rs
index 45f2d2d2a..7f13f9829 100644
--- a/vendor/winnow/src/_tutorial/chapter_7.rs
+++ b/vendor/winnow/src/_tutorial/chapter_7.rs
@@ -115,3 +115,4 @@ use crate::PResult;
use crate::Parser;
pub use super::chapter_6 as previous;
+pub use crate::_tutorial as table_of_contents;
diff --git a/vendor/winnow/src/_tutorial/mod.rs b/vendor/winnow/src/_tutorial/mod.rs
index e4b8392f9..224fe6a80 100644
--- a/vendor/winnow/src/_tutorial/mod.rs
+++ b/vendor/winnow/src/_tutorial/mod.rs
@@ -1,6 +1,6 @@
//! # Tutorial
//!
-//! Table of Content
+//! Table of Contents
pub mod chapter_0;
pub mod chapter_1;
diff --git a/vendor/winnow/src/binary/bits/mod.rs b/vendor/winnow/src/binary/bits/mod.rs
index 334c6bf00..b11ba43c7 100644
--- a/vendor/winnow/src/binary/bits/mod.rs
+++ b/vendor/winnow/src/binary/bits/mod.rs
@@ -10,6 +10,9 @@ use crate::stream::{AsBytes, Stream, StreamIsPartial, ToUsize};
use crate::trace::trace;
use crate::{unpeek, IResult, PResult, Parser};
+/// Number of bits in a byte
+const BYTE: usize = u8::BITS as usize;
+
/// Converts a byte-level input to a bit-level input
///
/// See [`bytes`] to convert it back.
@@ -57,12 +60,15 @@ where
Ok(((rest, offset), result)) => {
// If the next byte has been partially read, it will be sliced away as well.
// The parser functions might already slice away all fully read bytes.
- // That's why `offset / 8` isn't necessarily needed at all times.
- let remaining_bytes_index = offset / 8 + if offset % 8 == 0 { 0 } else { 1 };
+ // That's why `offset / BYTE` isn't necessarily needed at all times.
+ let remaining_bytes_index =
+ offset / BYTE + if offset % BYTE == 0 { 0 } else { 1 };
let (input, _) = rest.peek_slice(remaining_bytes_index);
Ok((input, result))
}
- Err(ErrMode::Incomplete(n)) => Err(ErrMode::Incomplete(n.map(|u| u.get() / 8 + 1))),
+ Err(ErrMode::Incomplete(n)) => {
+ Err(ErrMode::Incomplete(n.map(|u| u.get() / BYTE + 1)))
+ }
Err(e) => Err(e.convert()),
}
}),
@@ -109,10 +115,10 @@ where
trace(
"bytes",
unpeek(move |(input, offset): (I, usize)| {
- let (inner, _) = if offset % 8 != 0 {
- input.peek_slice(1 + offset / 8)
+ let (inner, _) = if offset % BYTE != 0 {
+ input.peek_slice(1 + offset / BYTE)
} else {
- input.peek_slice(offset / 8)
+ input.peek_slice(offset / BYTE)
};
let i = (input, offset);
match parser.parse_peek(inner) {
@@ -120,13 +126,15 @@ where
Err(ErrMode::Incomplete(Needed::Unknown)) => {
Err(ErrMode::Incomplete(Needed::Unknown))
}
- Err(ErrMode::Incomplete(Needed::Size(sz))) => Err(match sz.get().checked_mul(8) {
- Some(v) => ErrMode::Incomplete(Needed::new(v)),
- None => ErrMode::Cut(E2::assert(
- &i,
- "overflow in turning needed bytes into needed bits",
- )),
- }),
+ Err(ErrMode::Incomplete(Needed::Size(sz))) => {
+ Err(match sz.get().checked_mul(BYTE) {
+ Some(v) => ErrMode::Incomplete(Needed::new(v)),
+ None => ErrMode::Cut(E2::assert(
+ &i,
+ "overflow in turning needed bytes into needed bits",
+ )),
+ })
+ }
Err(e) => Err(e.convert()),
}
}),
@@ -196,8 +204,7 @@ where
if count == 0 {
Ok(((input, bit_offset), 0u8.into()))
} else {
- let cnt = (count + bit_offset).div(8);
- if input.eof_offset() * 8 < count + bit_offset {
+ if input.eof_offset() * BYTE < count + bit_offset {
if PARTIAL && input.is_partial() {
Err(ErrMode::Incomplete(Needed::new(count)))
} else {
@@ -207,6 +214,7 @@ where
))
}
} else {
+ let cnt = (count + bit_offset).div(BYTE);
let mut acc: O = 0_u8.into();
let mut offset: usize = bit_offset;
let mut remaining: usize = count;
@@ -222,13 +230,13 @@ where
(byte << offset >> offset).into()
};
- if remaining < 8 - offset {
- acc += val >> (8 - offset - remaining);
+ if remaining < BYTE - offset {
+ acc += val >> (BYTE - offset - remaining);
end_offset = remaining + offset;
break;
} else {
- acc += val << (remaining - (8 - offset));
- remaining -= 8 - offset;
+ acc += val << (remaining - (BYTE - offset));
+ remaining -= BYTE - offset;
offset = 0;
}
}
diff --git a/vendor/winnow/src/combinator/branch.rs b/vendor/winnow/src/combinator/branch.rs
index 2a712ec1d..b909ff1c7 100644
--- a/vendor/winnow/src/combinator/branch.rs
+++ b/vendor/winnow/src/combinator/branch.rs
@@ -112,6 +112,31 @@ pub fn permutation<I: Stream, O, E: ParserError<I>, List: Permutation<I, O, E>>(
trace("permutation", move |i: &mut I| l.permutation(i))
}
+impl<const N: usize, I: Stream, O, E: ParserError<I>, P: Parser<I, O, E>> Alt<I, O, E> for [P; N] {
+ fn choice(&mut self, input: &mut I) -> PResult<O, E> {
+ let mut error: Option<E> = None;
+
+ let start = input.checkpoint();
+ for branch in self {
+ input.reset(start.clone());
+ match branch.parse_next(input) {
+ Err(ErrMode::Backtrack(e)) => {
+ error = match error {
+ Some(error) => Some(error.or(e)),
+ None => Some(e),
+ };
+ }
+ res => return res,
+ }
+ }
+
+ match error {
+ Some(e) => Err(ErrMode::Backtrack(e.append(input, ErrorKind::Alt))),
+ None => Err(ErrMode::assert(input, "`alt` needs at least one parser")),
+ }
+ }
+}
+
macro_rules! alt_trait(
($first:ident $second:ident $($id: ident)+) => (
alt_trait!(__impl $first $second; $($id)+);
diff --git a/vendor/winnow/src/combinator/mod.rs b/vendor/winnow/src/combinator/mod.rs
index d76ef8e5f..ec68e48e2 100644
--- a/vendor/winnow/src/combinator/mod.rs
+++ b/vendor/winnow/src/combinator/mod.rs
@@ -8,8 +8,8 @@
//!
//! | combinator | usage | input | output | comment |
//! |---|---|---|---|---|
-//! | [`one_of`][crate::token::one_of] | `one_of("abc")` | `"abc"` | `Ok(("bc", 'a'))` |Matches one of the provided characters (works with non ASCII characters too)|
-//! | [`none_of`][crate::token::none_of] | `none_of("abc")` | `"xyab"` | `Ok(("yab", 'x'))` |Matches anything but the provided characters|
+//! | [`one_of`][crate::token::one_of] | `one_of(['a', 'b', 'c'])` | `"abc"` | `Ok(("bc", 'a'))` |Matches one of the provided characters (works with non ASCII characters too)|
+//! | [`none_of`][crate::token::none_of] | `none_of(['a', 'b', 'c'])` | `"xyab"` | `Ok(("yab", 'x'))` |Matches anything but the provided characters|
//! | [`tag`][crate::token::tag] | `"hello"` | `"hello world"` | `Ok((" world", "hello"))` |Recognizes a specific suite of characters or bytes|
//! | [`tag_no_case`][crate::token::tag_no_case] | `tag_no_case("hello")` | `"HeLLo World"` | `Ok((" World", "HeLLo"))` |Case insensitive comparison. Note that case insensitive comparison is not well defined for unicode, and that you might have bad surprises|
//! | [`take`][crate::token::take] | `take(4)` | `"hello"` | `Ok(("o", "hell"))` |Takes a specific number of bytes or characters|
diff --git a/vendor/winnow/src/combinator/parser.rs b/vendor/winnow/src/combinator/parser.rs
index 969c2d525..fb11adc15 100644
--- a/vendor/winnow/src/combinator/parser.rs
+++ b/vendor/winnow/src/combinator/parser.rs
@@ -14,12 +14,16 @@ pub struct ByRef<'p, P> {
}
impl<'p, P> ByRef<'p, P> {
+ #[inline(always)]
pub(crate) fn new(p: &'p mut P) -> Self {
Self { p }
}
}
-impl<'p, I, O, E, P: Parser<I, O, E>> Parser<I, O, E> for ByRef<'p, P> {
+impl<'p, I, O, E, P> Parser<I, O, E> for ByRef<'p, P>
+where
+ P: Parser<I, O, E>,
+{
#[inline(always)]
fn parse_next(&mut self, i: &mut I) -> PResult<O, E> {
self.p.parse_next(i)
@@ -46,6 +50,7 @@ where
F: Parser<I, O, E>,
G: Fn(O) -> O2,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, map: G) -> Self {
Self {
parser,
@@ -97,6 +102,7 @@ where
I: Stream,
E: FromExternalError<I, E2>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, map: G) -> Self {
Self {
parser,
@@ -154,6 +160,7 @@ where
I: Stream,
E: ParserError<I>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, map: G) -> Self {
Self {
parser,
@@ -210,6 +217,7 @@ where
O: StreamIsPartial,
I: Stream,
{
+ #[inline(always)]
pub(crate) fn new(outer: F, inner: G) -> Self {
Self {
outer,
@@ -265,6 +273,7 @@ where
O: crate::stream::ParseSlice<O2>,
E: ParserError<I>,
{
+ #[inline(always)]
pub(crate) fn new(p: P) -> Self {
Self {
p,
@@ -319,6 +328,7 @@ where
G: FnMut(O) -> H,
H: Parser<I, O2, E>,
{
+ #[inline(always)]
pub(crate) fn new(f: F, g: G) -> Self {
Self {
f,
@@ -352,6 +362,7 @@ pub struct CompleteErr<F> {
}
impl<F> CompleteErr<F> {
+ #[inline(always)]
pub(crate) fn new(f: F) -> Self {
Self { f }
}
@@ -405,6 +416,7 @@ where
O2: ?Sized,
E: ParserError<I>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, filter: G) -> Self {
Self {
parser,
@@ -458,6 +470,7 @@ where
F: Parser<I, O, E>,
O2: Clone,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, val: O2) -> Self {
Self {
parser,
@@ -496,6 +509,7 @@ impl<F, I, O, E> Void<F, I, O, E>
where
F: Parser<I, O, E>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -534,6 +548,7 @@ where
F: Parser<I, O, E>,
I: Stream,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -582,6 +597,7 @@ where
F: Parser<I, O, E>,
I: Stream,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -630,6 +646,7 @@ where
F: Parser<I, O, E>,
I: Stream + Location,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -673,6 +690,7 @@ where
F: Parser<I, O, E>,
I: Stream + Location,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -717,6 +735,7 @@ where
F: Parser<I, O, E>,
O: Into<O2>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -758,6 +777,7 @@ where
F: Parser<I, O, E>,
E: Into<E2>,
{
+ #[inline(always)]
pub(crate) fn new(parser: F) -> Self {
Self {
parser,
@@ -808,6 +828,7 @@ where
E: AddContext<I, C>,
C: Clone + crate::lib::std::fmt::Debug,
{
+ #[inline(always)]
pub(crate) fn new(parser: F, context: C) -> Self {
Self {
parser,
@@ -835,7 +856,7 @@ where
trace(name, move |i: &mut I| {
(self.parser)
.parse_next(i)
- .map_err(|err| err.map(|err| err.add_context(i, self.context.clone())))
+ .map_err(|err| err.add_context(i, self.context.clone()))
})
.parse_next(i)
}
diff --git a/vendor/winnow/src/combinator/tests.rs b/vendor/winnow/src/combinator/tests.rs
index 62dc420e5..9d2b49d80 100644
--- a/vendor/winnow/src/combinator/tests.rs
+++ b/vendor/winnow/src/combinator/tests.rs
@@ -13,6 +13,7 @@ use crate::stream::Stream;
use crate::token::take;
use crate::unpeek;
use crate::IResult;
+use crate::PResult;
use crate::Parser;
use crate::Partial;
@@ -649,6 +650,28 @@ fn alt_incomplete() {
}
#[test]
+fn alt_array() {
+ fn alt1<'i>(i: &mut &'i [u8]) -> PResult<&'i [u8]> {
+ alt(["a", "bc", "def"]).parse_next(i)
+ }
+
+ let i = &b"a"[..];
+ assert_eq!(alt1.parse_peek(i), Ok((&b""[..], (&b"a"[..]))));
+
+ let i = &b"bc"[..];
+ assert_eq!(alt1.parse_peek(i), Ok((&b""[..], (&b"bc"[..]))));
+
+ let i = &b"defg"[..];
+ assert_eq!(alt1.parse_peek(i), Ok((&b"g"[..], (&b"def"[..]))));
+
+ let i = &b"z"[..];
+ assert_eq!(
+ alt1.parse_peek(i),
+ Err(ErrMode::Backtrack(error_position!(&i, ErrorKind::Tag)))
+ );
+}
+
+#[test]
fn permutation_test() {
#[allow(clippy::type_complexity)]
fn perm(i: Partial<&[u8]>) -> IResult<Partial<&[u8]>, (&[u8], &[u8], &[u8])> {
diff --git a/vendor/winnow/src/error.rs b/vendor/winnow/src/error.rs
index d40e8244b..449bebc55 100644
--- a/vendor/winnow/src/error.rs
+++ b/vendor/winnow/src/error.rs
@@ -17,6 +17,7 @@
//! - [`ErrorKind`]
//! - [`InputError`] (mostly for testing)
//! - [`ContextError`]
+//! - [`TreeError`] (mostly for testing)
//! - [Custom errors][crate::_topic::error]
#[cfg(feature = "alloc")]
@@ -88,7 +89,7 @@ impl Needed {
}
}
-/// The `Err` enum indicates the parser was not successful
+/// Add parse error state to [`ParserError`]s
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(nightly, warn(rustdoc::missing_doc_code_examples))]
pub enum ErrMode<E> {
@@ -120,6 +121,7 @@ pub enum ErrMode<E> {
impl<E> ErrMode<E> {
/// Tests if the result is Incomplete
+ #[inline]
pub fn is_incomplete(&self) -> bool {
matches!(self, ErrMode::Incomplete(_))
}
@@ -164,6 +166,7 @@ impl<E> ErrMode<E> {
///
/// Returns `None` for [`ErrMode::Incomplete`]
#[cfg_attr(debug_assertions, track_caller)]
+ #[inline(always)]
pub fn into_inner(self) -> Option<E> {
match self {
ErrMode::Backtrack(e) | ErrMode::Cut(e) => Some(e),
@@ -173,11 +176,13 @@ impl<E> ErrMode<E> {
}
impl<I, E: ParserError<I>> ParserError<I> for ErrMode<E> {
+ #[inline(always)]
fn from_error_kind(input: &I, kind: ErrorKind) -> Self {
ErrMode::Backtrack(E::from_error_kind(input, kind))
}
#[cfg_attr(debug_assertions, track_caller)]
+ #[inline(always)]
fn assert(input: &I, message: &'static str) -> Self
where
I: crate::lib::std::fmt::Debug,
@@ -185,6 +190,7 @@ impl<I, E: ParserError<I>> ParserError<I> for ErrMode<E> {
ErrMode::Backtrack(E::assert(input, message))
}
+ #[inline]
fn append(self, input: &I, kind: ErrorKind) -> Self {
match self {
ErrMode::Backtrack(e) => ErrMode::Backtrack(e.append(input, kind)),
@@ -205,11 +211,19 @@ impl<I, EXT, E> FromExternalError<I, EXT> for ErrMode<E>
where
E: FromExternalError<I, EXT>,
{
+ #[inline(always)]
fn from_external_error(input: &I, kind: ErrorKind, e: EXT) -> Self {
ErrMode::Backtrack(E::from_external_error(input, kind, e))
}
}
+impl<I, C, E: AddContext<I, C>> AddContext<I, C> for ErrMode<E> {
+ #[inline(always)]
+ fn add_context(self, input: &I, ctx: C) -> Self {
+ self.map(|err| err.add_context(input, ctx))
+ }
+}
+
impl<T: Clone> ErrMode<InputError<T>> {
/// Maps `ErrMode<InputError<T>>` to `ErrMode<InputError<U>>` with the given `F: T -> U`
pub fn map_input<U: Clone, F>(self, f: F) -> ErrMode<InputError<U>>
@@ -276,6 +290,7 @@ pub trait ParserError<I>: Sized {
///
/// For example, this would be used by [`alt`][crate::combinator::alt] to report the error from
/// each case.
+ #[inline]
fn or(self, other: Self) -> Self {
other
}
@@ -330,19 +345,25 @@ impl<I: Clone> InputError<I> {
pub fn new(input: I, kind: ErrorKind) -> Self {
Self { input, kind }
}
+
+ /// Translate the input type
+ #[inline]
+ pub fn map_input<I2: Clone, O: Fn(I) -> I2>(self, op: O) -> InputError<I2> {
+ InputError {
+ input: op(self.input),
+ kind: self.kind,
+ }
+ }
}
#[cfg(feature = "alloc")]
-impl<'i, I: Clone + ToOwned + ?Sized> InputError<&'i I>
+impl<'i, I: ToOwned> InputError<&'i I>
where
<I as ToOwned>::Owned: Clone,
{
/// Obtaining ownership
pub fn into_owned(self) -> InputError<<I as ToOwned>::Owned> {
- InputError {
- input: self.input.to_owned(),
- kind: self.kind,
- }
+ self.map_input(ToOwned::to_owned)
}
}
@@ -397,7 +418,12 @@ impl<I: Clone> ErrorConvert<InputError<I>> for InputError<(I, usize)> {
/// The Display implementation allows the `std::error::Error` implementation
impl<I: Clone + fmt::Display> fmt::Display for InputError<I> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "{} error starting at: {}", self.kind, self.input)
+ write!(
+ f,
+ "{} error starting at: {}",
+ self.kind.description(),
+ self.input
+ )
}
}
@@ -464,6 +490,16 @@ impl<C> ContextError<C> {
}
}
+impl<C: Clone> Clone for ContextError<C> {
+ fn clone(&self) -> Self {
+ Self {
+ context: self.context.clone(),
+ #[cfg(feature = "std")]
+ cause: self.cause.as_ref().map(|e| e.to_string().into()),
+ }
+ }
+}
+
impl<C> Default for ContextError<C> {
#[inline]
fn default() -> Self {
@@ -606,6 +642,15 @@ pub enum StrContext {
Expected(StrContextValue),
}
+impl crate::lib::std::fmt::Display for StrContext {
+ fn fmt(&self, f: &mut crate::lib::std::fmt::Formatter<'_>) -> crate::lib::std::fmt::Result {
+ match self {
+ Self::Label(name) => write!(f, "invalid {name}"),
+ Self::Expected(value) => write!(f, "expected {value}"),
+ }
+ }
+}
+
/// See [`StrContext`]
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
@@ -619,12 +664,14 @@ pub enum StrContextValue {
}
impl From<char> for StrContextValue {
+ #[inline]
fn from(inner: char) -> Self {
Self::CharLiteral(inner)
}
}
impl From<&'static str> for StrContextValue {
+ #[inline]
fn from(inner: &'static str) -> Self {
Self::StringLiteral(inner)
}
@@ -645,6 +692,395 @@ impl crate::lib::std::fmt::Display for StrContextValue {
}
}
+/// Trace all error paths, particularly for tests
+#[derive(Debug)]
+#[cfg(feature = "std")]
+pub enum TreeError<I, C = StrContext> {
+ /// Initial error that kicked things off
+ Base(TreeErrorBase<I>),
+ /// Traces added to the error while walking back up the stack
+ Stack {
+ /// Initial error that kicked things off
+ base: Box<Self>,
+ /// Traces added to the error while walking back up the stack
+ stack: Vec<TreeErrorFrame<I, C>>,
+ },
+ /// All failed branches of an `alt`
+ Alt(Vec<Self>),
+}
+
+/// See [`TreeError::Stack`]
+#[derive(Debug)]
+#[cfg(feature = "std")]
+pub enum TreeErrorFrame<I, C = StrContext> {
+ /// See [`ParserError::append`]
+ Kind(TreeErrorBase<I>),
+ /// See [`AddContext::add_context`]
+ Context(TreeErrorContext<I, C>),
+}
+
+/// See [`TreeErrorFrame::Kind`], [`ParserError::append`]
+#[derive(Debug)]
+#[cfg(feature = "std")]
+pub struct TreeErrorBase<I> {
+ /// Parsed input, at the location where the error occurred
+ pub input: I,
+ /// Debug context
+ pub kind: ErrorKind,
+ /// See [`FromExternalError::from_external_error`]
+ pub cause: Option<Box<dyn std::error::Error + Send + Sync + 'static>>,
+}
+
+/// See [`TreeErrorFrame::Context`], [`AddContext::add_context`]
+#[derive(Debug)]
+#[cfg(feature = "std")]
+pub struct TreeErrorContext<I, C = StrContext> {
+ /// Parsed input, at the location where the error occurred
+ pub input: I,
+ /// See [`AddContext::add_context`]
+ pub context: C,
+}
+
+#[cfg(feature = "std")]
+impl<'i, I: ToOwned, C> TreeError<&'i I, C>
+where
+ <I as ToOwned>::Owned: Clone,
+{
+ /// Obtaining ownership
+ pub fn into_owned(self) -> TreeError<<I as ToOwned>::Owned, C> {
+ self.map_input(ToOwned::to_owned)
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I, C> TreeError<I, C>
+where
+ I: Clone,
+{
+ /// Translate the input type
+ pub fn map_input<I2: Clone, O: Clone + Fn(I) -> I2>(self, op: O) -> TreeError<I2, C> {
+ match self {
+ TreeError::Base(base) => TreeError::Base(TreeErrorBase {
+ input: op(base.input),
+ kind: base.kind,
+ cause: base.cause,
+ }),
+ TreeError::Stack { base, stack } => {
+ let base = Box::new(base.map_input(op.clone()));
+ let stack = stack
+ .into_iter()
+ .map(|frame| match frame {
+ TreeErrorFrame::Kind(kind) => TreeErrorFrame::Kind(TreeErrorBase {
+ input: op(kind.input),
+ kind: kind.kind,
+ cause: kind.cause,
+ }),
+ TreeErrorFrame::Context(context) => {
+ TreeErrorFrame::Context(TreeErrorContext {
+ input: op(context.input),
+ context: context.context,
+ })
+ }
+ })
+ .collect();
+ TreeError::Stack { base, stack }
+ }
+ TreeError::Alt(alt) => {
+ TreeError::Alt(alt.into_iter().map(|e| e.map_input(op.clone())).collect())
+ }
+ }
+ }
+
+ fn append_frame(self, frame: TreeErrorFrame<I, C>) -> Self {
+ match self {
+ TreeError::Stack { base, mut stack } => {
+ stack.push(frame);
+ TreeError::Stack { base, stack }
+ }
+ base => TreeError::Stack {
+ base: Box::new(base),
+ stack: vec![frame],
+ },
+ }
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I, C> ParserError<I> for TreeError<I, C>
+where
+ I: Clone,
+{
+ fn from_error_kind(input: &I, kind: ErrorKind) -> Self {
+ TreeError::Base(TreeErrorBase {
+ input: input.clone(),
+ kind,
+ cause: None,
+ })
+ }
+
+ fn append(self, input: &I, kind: ErrorKind) -> Self {
+ let frame = TreeErrorFrame::Kind(TreeErrorBase {
+ input: input.clone(),
+ kind,
+ cause: None,
+ });
+ self.append_frame(frame)
+ }
+
+ fn or(self, other: Self) -> Self {
+ match (self, other) {
+ (TreeError::Alt(mut first), TreeError::Alt(second)) => {
+ // Just in case an implementation does a divide-and-conquer algorithm
+ //
+ // To prevent mixing `alt`s at different levels, parsers should
+ // `alt_err.append(input, ErrorKind::Alt)`.
+ first.extend(second);
+ TreeError::Alt(first)
+ }
+ (TreeError::Alt(mut alt), new) | (new, TreeError::Alt(mut alt)) => {
+ alt.push(new);
+ TreeError::Alt(alt)
+ }
+ (first, second) => TreeError::Alt(vec![first, second]),
+ }
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I, C> AddContext<I, C> for TreeError<I, C>
+where
+ I: Clone,
+{
+ fn add_context(self, input: &I, context: C) -> Self {
+ let frame = TreeErrorFrame::Context(TreeErrorContext {
+ input: input.clone(),
+ context,
+ });
+ self.append_frame(frame)
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I, C, E: std::error::Error + Send + Sync + 'static> FromExternalError<I, E> for TreeError<I, C>
+where
+ I: Clone,
+{
+ fn from_external_error(input: &I, kind: ErrorKind, e: E) -> Self {
+ TreeError::Base(TreeErrorBase {
+ input: input.clone(),
+ kind,
+ cause: Some(Box::new(e)),
+ })
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I, C> TreeError<I, C>
+where
+ I: Clone + std::fmt::Display,
+ C: fmt::Display,
+{
+ fn write(&self, f: &mut fmt::Formatter<'_>, indent: usize) -> fmt::Result {
+ let child_indent = indent + 2;
+ match self {
+ TreeError::Base(base) => {
+ writeln!(f, "{:indent$}{base}", "")?;
+ }
+ TreeError::Stack { base, stack } => {
+ base.write(f, indent)?;
+ for (level, frame) in stack.iter().enumerate() {
+ match frame {
+ TreeErrorFrame::Kind(frame) => {
+ writeln!(f, "{:child_indent$}{level}: {frame}", "")?;
+ }
+ TreeErrorFrame::Context(frame) => {
+ writeln!(f, "{:child_indent$}{level}: {frame}", "")?;
+ }
+ }
+ }
+ }
+ TreeError::Alt(alt) => {
+ writeln!(f, "{:indent$}during one of:", "")?;
+ for child in alt {
+ child.write(f, child_indent)?;
+ }
+ }
+ }
+
+ Ok(())
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I: Clone + fmt::Display> fmt::Display for TreeErrorBase<I> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ if let Some(cause) = self.cause.as_ref() {
+ write!(f, "caused by {cause}")?;
+ } else {
+ let kind = self.kind.description();
+ write!(f, "in {kind}")?;
+ }
+ let input = abbreviate(self.input.to_string());
+ write!(f, " at '{input}'")?;
+ Ok(())
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I: Clone + fmt::Display, C: fmt::Display> fmt::Display for TreeErrorContext<I, C> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ let context = &self.context;
+ let input = abbreviate(self.input.to_string());
+ write!(f, "{context} at '{input}'")?;
+ Ok(())
+ }
+}
+
+#[cfg(feature = "std")]
+impl<
+ I: Clone + fmt::Debug + fmt::Display + Sync + Send + 'static,
+ C: fmt::Display + fmt::Debug,
+ > std::error::Error for TreeError<I, C>
+{
+}
+
+#[cfg(feature = "std")]
+fn abbreviate(input: String) -> String {
+ let mut abbrev = None;
+
+ if let Some((line, _)) = input.split_once('\n') {
+ abbrev = Some(line);
+ }
+
+ let max_len = 20;
+ let current = abbrev.unwrap_or(&input);
+ if max_len < current.len() {
+ if let Some((index, _)) = current.char_indices().nth(max_len) {
+ abbrev = Some(&current[..index]);
+ }
+ }
+
+ if let Some(abbrev) = abbrev {
+ format!("{abbrev}...")
+ } else {
+ input
+ }
+}
+
+#[cfg(feature = "std")]
+impl<I: Clone + fmt::Display, C: fmt::Display> fmt::Display for TreeError<I, C> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ self.write(f, 0)
+ }
+}
+
+/// Deprecated, replaced with [`ContextError`]
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+#[deprecated(since = "0.5.8", note = "Replaced with `ContextError`")]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct VerboseError<I: Clone, C = &'static str> {
+ /// Accumulated error information
+ pub errors: crate::lib::std::vec::Vec<(I, VerboseErrorKind<C>)>,
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<'i, I: ToOwned, C> VerboseError<&'i I, C>
+where
+ <I as ToOwned>::Owned: Clone,
+{
+ /// Obtaining ownership
+ pub fn into_owned(self) -> VerboseError<<I as ToOwned>::Owned, C> {
+ self.map_input(ToOwned::to_owned)
+ }
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<I: Clone, C> VerboseError<I, C> {
+ /// Translate the input type
+ pub fn map_input<I2: Clone, O>(self, op: O) -> VerboseError<I2, C>
+ where
+ O: Fn(I) -> I2,
+ {
+ VerboseError {
+ errors: self.errors.into_iter().map(|(i, k)| (op(i), k)).collect(),
+ }
+ }
+}
+
+/// Deprecated, replaced with [`ContextError`]
+#[cfg(feature = "std")]
+#[deprecated(since = "0.5.8", note = "Replaced with `ContextError`")]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum VerboseErrorKind<C = &'static str> {
+ /// Static string added by the `context` function
+ Context(C),
+ /// Error kind given by various parsers
+ Winnow(ErrorKind),
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<I: Clone, C> ParserError<I> for VerboseError<I, C> {
+ fn from_error_kind(input: &I, kind: ErrorKind) -> Self {
+ VerboseError {
+ errors: vec![(input.clone(), VerboseErrorKind::Winnow(kind))],
+ }
+ }
+
+ fn append(mut self, input: &I, kind: ErrorKind) -> Self {
+ self.errors
+ .push((input.clone(), VerboseErrorKind::Winnow(kind)));
+ self
+ }
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<I: Clone, C> AddContext<I, C> for VerboseError<I, C> {
+ fn add_context(mut self, input: &I, ctx: C) -> Self {
+ self.errors
+ .push((input.clone(), VerboseErrorKind::Context(ctx)));
+ self
+ }
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<I: Clone, C, E> FromExternalError<I, E> for VerboseError<I, C> {
+ /// Create a new error from an input position and an external error
+ fn from_external_error(input: &I, kind: ErrorKind, _e: E) -> Self {
+ Self::from_error_kind(input, kind)
+ }
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<I: Clone + fmt::Display, C: fmt::Display> fmt::Display for VerboseError<I, C> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ writeln!(f, "Parse error:")?;
+ for (input, error) in &self.errors {
+ match error {
+ VerboseErrorKind::Winnow(e) => writeln!(f, "{} at: {}", e.description(), input)?,
+ VerboseErrorKind::Context(s) => writeln!(f, "in section '{}', at: {}", s, input)?,
+ }
+ }
+
+ Ok(())
+ }
+}
+
+#[cfg(feature = "std")]
+#[allow(deprecated)]
+impl<
+ I: Clone + fmt::Debug + fmt::Display + Sync + Send + 'static,
+ C: fmt::Display + fmt::Debug,
+ > std::error::Error for VerboseError<I, C>
+{
+}
+
/// Provide some minor debug context for errors
#[rustfmt::skip]
#[derive(Debug,PartialEq,Eq,Hash,Clone,Copy)]
@@ -684,10 +1120,12 @@ impl ErrorKind {
}
impl<I> ParserError<I> for ErrorKind {
+ #[inline]
fn from_error_kind(_input: &I, kind: ErrorKind) -> Self {
kind
}
+ #[inline]
fn append(self, _: &I, _: ErrorKind) -> Self {
self
}
@@ -697,6 +1135,7 @@ impl<I, C> AddContext<I, C> for ErrorKind {}
impl<I, E> FromExternalError<I, E> for ErrorKind {
/// Create a new error from an input position and an external error
+ #[inline]
fn from_external_error(_input: &I, kind: ErrorKind, _e: E) -> Self {
kind
}
@@ -750,6 +1189,12 @@ impl<I, E> ParseError<I, E> {
pub fn inner(&self) -> &E {
&self.inner
}
+
+ /// The original [`ParserError`]
+ #[inline]
+ pub fn into_inner(self) -> E {
+ self.inner
+ }
}
impl<I, E> core::fmt::Display for ParseError<I, E>
diff --git a/vendor/winnow/src/macros.rs b/vendor/winnow/src/macros.rs
index b3078c605..35279bae8 100644
--- a/vendor/winnow/src/macros.rs
+++ b/vendor/winnow/src/macros.rs
@@ -38,6 +38,7 @@
/// assert_eq!(escaped.parse_peek("\\nHello"), Ok(("Hello", '\n')));
/// ```
#[macro_export]
+#[doc(hidden)] // forced to be visible in intended location
macro_rules! dispatch {
($match_parser: expr; $( $pat:pat $(if $pred:expr)? => $expr: expr ),+ $(,)? ) => {
$crate::trace::trace("dispatch", move |i: &mut _|
diff --git a/vendor/winnow/src/parser.rs b/vendor/winnow/src/parser.rs
index d160a8ef8..b59e4cd83 100644
--- a/vendor/winnow/src/parser.rs
+++ b/vendor/winnow/src/parser.rs
@@ -128,6 +128,7 @@ pub trait Parser<I, O, E> {
/// }
/// }
/// ```
+ #[inline(always)]
fn by_ref(&mut self) -> ByRef<'_, Self>
where
Self: core::marker::Sized,
@@ -151,6 +152,7 @@ pub trait Parser<I, O, E> {
/// # }
/// ```
#[doc(alias = "to")]
+ #[inline(always)]
fn value<O2>(self, val: O2) -> Value<Self, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -174,6 +176,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parser.parse_peek("123abcd;"), Err(ErrMode::Backtrack(InputError::new("123abcd;", ErrorKind::Slice))));
/// # }
/// ```
+ #[inline(always)]
fn void(self) -> Void<Self, I, O, E>
where
Self: core::marker::Sized,
@@ -202,6 +205,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(bytes, Ok(("", vec![97, 98, 99, 100])));
/// # }
/// ```
+ #[inline(always)]
fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -227,6 +231,7 @@ pub trait Parser<I, O, E> {
/// # }
/// ```
#[doc(alias = "concat")]
+ #[inline(always)]
fn recognize(self) -> Recognize<Self, I, O, E>
where
Self: core::marker::Sized,
@@ -272,6 +277,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(recognize_parser.parse_peek("abcd"), consumed_parser.parse_peek("abcd"));
/// ```
#[doc(alias = "consumed")]
+ #[inline(always)]
fn with_recognized(self) -> WithRecognized<Self, I, O, E>
where
Self: core::marker::Sized,
@@ -296,6 +302,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parser.parse(Located::new("abcd,efgh")), Ok((0..4, 5..9)));
/// assert_eq!(parser.parse_peek(Located::new("abcd;")),Err(ErrMode::Backtrack(InputError::new(Located::new("abcd;").peek_slice(4).0, ErrorKind::Verify))));
/// ```
+ #[inline(always)]
fn span(self) -> Span<Self, I, O, E>
where
Self: core::marker::Sized,
@@ -344,6 +351,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(recognize_parser.parse_peek(Located::new("abcd")), consumed_parser.parse_peek(Located::new("abcd")));
/// # }
/// ```
+ #[inline(always)]
fn with_span(self) -> WithSpan<Self, I, O, E>
where
Self: core::marker::Sized,
@@ -370,6 +378,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parser.parse_peek("abc"), Err(ErrMode::Backtrack(InputError::new("abc", ErrorKind::Slice))));
/// # }
/// ```
+ #[inline(always)]
fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
where
G: Fn(O) -> O2,
@@ -399,6 +408,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parse.parse_peek("123456"), Err(ErrMode::Backtrack(InputError::new("123456", ErrorKind::Verify))));
/// # }
/// ```
+ #[inline(always)]
fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
where
Self: core::marker::Sized,
@@ -433,6 +443,7 @@ pub trait Parser<I, O, E> {
#[doc(alias = "satisfy_map")]
#[doc(alias = "filter_map")]
#[doc(alias = "map_opt")]
+ #[inline(always)]
fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -475,6 +486,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(length_data.parse_peek(&[2, 0, 1, 2][..]), Ok((&[2][..], &[0, 1][..])));
/// assert_eq!(length_data.parse_peek(&[4, 0, 1, 2][..]), Err(ErrMode::Backtrack(InputError::new(&[0, 1, 2][..], ErrorKind::Slice))));
/// ```
+ #[inline(always)]
fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -501,6 +513,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(digits.parse_peek("123"), Err(ErrMode::Backtrack(InputError::new("123", ErrorKind::Slice))));
/// # }
/// ```
+ #[inline(always)]
fn and_then<G, O2>(self, inner: G) -> AndThen<Self, G, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -531,6 +544,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parser.parse_peek("abc"), Err(ErrMode::Backtrack(InputError::new("abc", ErrorKind::Slice))));
/// ```
#[doc(alias = "from_str")]
+ #[inline(always)]
fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -562,6 +576,7 @@ pub trait Parser<I, O, E> {
/// ```
#[doc(alias = "satisfy")]
#[doc(alias = "filter")]
+ #[inline(always)]
fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
where
Self: core::marker::Sized,
@@ -579,6 +594,7 @@ pub trait Parser<I, O, E> {
/// This is used mainly to add user friendly information
/// to errors when backtracking through a parse tree.
#[doc(alias = "labelled")]
+ #[inline(always)]
fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
where
Self: core::marker::Sized,
@@ -604,6 +620,7 @@ pub trait Parser<I, O, E> {
/// assert_eq!(parser.parse_peek(Partial::new("abcd")), Err(ErrMode::Backtrack(InputError::new(Partial::new("abcd"), ErrorKind::Complete))));
/// # }
/// ```
+ #[inline(always)]
fn complete_err(self) -> CompleteErr<Self>
where
Self: core::marker::Sized,
@@ -612,6 +629,7 @@ pub trait Parser<I, O, E> {
}
/// Convert the parser's error to another type using [`std::convert::From`]
+ #[inline(always)]
fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
where
Self: core::marker::Sized,
diff --git a/vendor/winnow/src/stream/mod.rs b/vendor/winnow/src/stream/mod.rs
index fcacbd78f..5f2152e27 100644
--- a/vendor/winnow/src/stream/mod.rs
+++ b/vendor/winnow/src/stream/mod.rs
@@ -2684,7 +2684,35 @@ fn memchr(token: u8, slice: &[u8]) -> Option<usize> {
#[cfg(feature = "simd")]
#[inline(always)]
fn memmem(slice: &[u8], tag: &[u8]) -> Option<usize> {
- memchr::memmem::find(slice, tag)
+ if tag.len() > slice.len() {
+ return None;
+ }
+
+ let (&substr_first, substr_rest) = match tag.split_first() {
+ Some(split) => split,
+ // an empty substring is found at position 0
+ // This matches the behavior of str.find("").
+ None => return Some(0),
+ };
+
+ if substr_rest.is_empty() {
+ return memchr::memchr(substr_first, slice);
+ }
+
+ let mut offset = 0;
+ let haystack = &slice[..slice.len() - substr_rest.len()];
+
+ while let Some(position) = memchr::memchr(substr_first, &haystack[offset..]) {
+ offset += position;
+ let next_offset = offset + 1;
+ if &slice[next_offset..][..substr_rest.len()] == substr_rest {
+ return Some(offset);
+ }
+
+ offset = next_offset;
+ }
+
+ None
}
#[cfg(not(feature = "simd"))]
diff --git a/vendor/winnow/src/trace/internals.rs b/vendor/winnow/src/trace/internals.rs
index b990ae7c7..c38b11eea 100644
--- a/vendor/winnow/src/trace/internals.rs
+++ b/vendor/winnow/src/trace/internals.rs
@@ -4,6 +4,63 @@ use std::io::Write;
use crate::error::ErrMode;
use crate::stream::Stream;
+use crate::*;
+
+pub struct Trace<P, D, I, O, E>
+where
+ P: Parser<I, O, E>,
+ I: Stream,
+ D: std::fmt::Display,
+{
+ parser: P,
+ name: D,
+ call_count: usize,
+ i: core::marker::PhantomData<I>,
+ o: core::marker::PhantomData<O>,
+ e: core::marker::PhantomData<E>,
+}
+
+impl<P, D, I, O, E> Trace<P, D, I, O, E>
+where
+ P: Parser<I, O, E>,
+ I: Stream,
+ D: std::fmt::Display,
+{
+ #[inline(always)]
+ pub fn new(parser: P, name: D) -> Self {
+ Self {
+ parser,
+ name,
+ call_count: 0,
+ i: Default::default(),
+ o: Default::default(),
+ e: Default::default(),
+ }
+ }
+}
+
+impl<P, D, I, O, E> Parser<I, O, E> for Trace<P, D, I, O, E>
+where
+ P: Parser<I, O, E>,
+ I: Stream,
+ D: std::fmt::Display,
+{
+ #[inline]
+ fn parse_next(&mut self, i: &mut I) -> PResult<O, E> {
+ let depth = Depth::new();
+ let original = i.checkpoint();
+ start(*depth, &self.name, self.call_count, i);
+
+ let res = self.parser.parse_next(i);
+
+ let consumed = i.offset_from(&original);
+ let severity = Severity::with_result(&res);
+ end(*depth, &self.name, self.call_count, consumed, severity);
+ self.call_count += 1;
+
+ res
+ }
+}
pub struct Depth {
depth: usize,
@@ -107,7 +164,7 @@ pub fn start<I: Stream>(
(debug_slice, eof)
};
- let writer = anstyle_stream::stderr();
+ let writer = anstream::stderr();
let mut writer = writer.lock();
let _ = writeln!(
writer,
@@ -159,7 +216,7 @@ pub fn end(
),
};
- let writer = anstyle_stream::stderr();
+ let writer = anstream::stderr();
let mut writer = writer.lock();
let _ = writeln!(
writer,
@@ -197,7 +254,7 @@ pub fn result(depth: usize, name: &dyn crate::lib::std::fmt::Display, severity:
),
};
- let writer = anstyle_stream::stderr();
+ let writer = anstream::stderr();
let mut writer = writer.lock();
let _ = writeln!(
writer,
diff --git a/vendor/winnow/src/trace/mod.rs b/vendor/winnow/src/trace/mod.rs
index 316733e9a..cd96e0258 100644
--- a/vendor/winnow/src/trace/mod.rs
+++ b/vendor/winnow/src/trace/mod.rs
@@ -49,25 +49,11 @@ compile_error!("`debug` requires `std`");
#[cfg_attr(not(feature = "debug"), inline(always))]
pub fn trace<I: Stream, O, E>(
name: impl crate::lib::std::fmt::Display,
- mut parser: impl Parser<I, O, E>,
+ parser: impl Parser<I, O, E>,
) -> impl Parser<I, O, E> {
#[cfg(feature = "debug")]
{
- let mut call_count = 0;
- move |i: &mut I| {
- let depth = internals::Depth::new();
- let original = i.checkpoint();
- internals::start(*depth, &name, call_count, i);
-
- let res = parser.parse_next(i);
-
- let consumed = i.offset_from(&original);
- let severity = internals::Severity::with_result(&res);
- internals::end(*depth, &name, call_count, consumed, severity);
- call_count += 1;
-
- res
- }
+ internals::Trace::new(parser, name)
}
#[cfg(not(feature = "debug"))]
{