summaryrefslogtreecommitdiffstats
path: root/vendor/pest_derive
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/pest_derive
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pest_derive')
-rw-r--r--vendor/pest_derive/.cargo-checksum.json2
-rw-r--r--vendor/pest_derive/Cargo.lock66
-rw-r--r--vendor/pest_derive/Cargo.toml6
-rw-r--r--vendor/pest_derive/_README.md25
-rw-r--r--vendor/pest_derive/examples/base.pest2
-rw-r--r--vendor/pest_derive/examples/calc.pest5
-rw-r--r--vendor/pest_derive/examples/calc.rs1
-rw-r--r--vendor/pest_derive/tests/implicit.pest14
-rw-r--r--vendor/pest_derive/tests/implicit.rs25
9 files changed, 105 insertions, 41 deletions
diff --git a/vendor/pest_derive/.cargo-checksum.json b/vendor/pest_derive/.cargo-checksum.json
index 5423e76a2..34daf4746 100644
--- a/vendor/pest_derive/.cargo-checksum.json
+++ b/vendor/pest_derive/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.lock":"f4ef406536889c5b8f92fcae0e75388564476ce7fb2cb98343b2afe78b008a2e","Cargo.toml":"1e082a42fc3822c5abba13ee5e107ffc1059fd5cd3639590cfb01e20970f69c1","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"190b4279777e3cd3c5adf3258114b89be536fc647d819620ada15be39d2259cc","examples/calc.pest":"2b0147e136da04efd983bba4e6de82150f264e8b30766b97be65a585bb7e7377","examples/calc.rs":"39e03c6928bd6895853dec2aad726f053488c399252f0a28411f1fca6546ab3c","src/lib.rs":"ef3426de6a0c667066202be87f23a7605461884aba71eda8aae5f82b04846149","tests/grammar.pest":"00ae1134a07ddb3cb8cf748678039dffe719c25e0fc50dc36fc991f58ea3241d","tests/grammar.rs":"1c3edb14720066c8b19953d8c51f300dee454d107e70b8f83e55380347bef375","tests/grammar_inline.rs":"349527e75a1fc10e0208d3d88cbac427dd5999b8a2a79d2b9c981e73af22da37","tests/lists.pest":"96d90ad5eb7b14648fa8720f0a48e680327080b07251a4dd74e1a023625e9c1a","tests/lists.rs":"2dc0cb9c07f5b077743ce9313488599347061ea486e0f5160bff50b3d07ca72c","tests/reporting.pest":"f5bc8405ea117b76338e0003e359731a8aaf1a36672f31a6a639a4e67a65e331","tests/reporting.rs":"8b88238dc33abff5dbc76434a7468dceeb9db3dfa8826d44c8ea1d13d52431e8"},"package":"96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603"} \ No newline at end of file
+{"files":{"Cargo.lock":"f7e19a8573974919ab4d66c694b4a19528379a4cb3d2bcd7b510087856013c6c","Cargo.toml":"e4258325bf7f1b6480b586ca6089e8bdbd518c651fa7f65040b2d51b0bd86d02","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"647dbcab0b7ed9837cc066cb3731aa2db7fbecb0e9aa187995a0a7a03af3938d","examples/base.pest":"949b57af96904b47da714890dd1ab5ce8937a92aac71be1b5cc3c3573198ad24","examples/calc.pest":"4347730e9c77c74545b205e8aa5a1128c064056eb6bfe47d31d3e0f76d9c25ea","examples/calc.rs":"ed40ab7d7a03a16f1bae1cb021b80656518b067817a13b11a9b4ef1e1a7a47db","src/lib.rs":"ef3426de6a0c667066202be87f23a7605461884aba71eda8aae5f82b04846149","tests/grammar.pest":"00ae1134a07ddb3cb8cf748678039dffe719c25e0fc50dc36fc991f58ea3241d","tests/grammar.rs":"1c3edb14720066c8b19953d8c51f300dee454d107e70b8f83e55380347bef375","tests/grammar_inline.rs":"349527e75a1fc10e0208d3d88cbac427dd5999b8a2a79d2b9c981e73af22da37","tests/implicit.pest":"17b0ee9a85d8fc7532f8747ca6e872dd7292c62ee2c8dfea19b088d48bfe592e","tests/implicit.rs":"f29f6c7ba16a60e43cff9ace69db4f1489a15525a12ee1b0064c5e9dabc5d2e7","tests/lists.pest":"96d90ad5eb7b14648fa8720f0a48e680327080b07251a4dd74e1a023625e9c1a","tests/lists.rs":"2dc0cb9c07f5b077743ce9313488599347061ea486e0f5160bff50b3d07ca72c","tests/reporting.pest":"f5bc8405ea117b76338e0003e359731a8aaf1a36672f31a6a639a4e67a65e331","tests/reporting.rs":"8b88238dc33abff5dbc76434a7468dceeb9db3dfa8826d44c8ea1d13d52431e8"},"package":"be99c4c1d2fc2769b1d00239431d711d08f6efedcecb8b6e30707160aee99c15"} \ No newline at end of file
diff --git a/vendor/pest_derive/Cargo.lock b/vendor/pest_derive/Cargo.lock
index 9bf2a751a..9862dbd98 100644
--- a/vendor/pest_derive/Cargo.lock
+++ b/vendor/pest_derive/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "block-buffer"
-version = "0.10.3"
+version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
@@ -19,9 +19,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cpufeatures"
-version = "0.2.5"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
+checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
dependencies = [
"libc",
]
@@ -48,9 +48,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.6"
+version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
@@ -58,21 +58,21 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.139"
+version = "0.2.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
+checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "once_cell"
-version = "1.16.0"
+version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "pest"
-version = "2.5.2"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4"
+checksum = "7b1403e8401ad5dedea73c626b99758535b342502f8d1e361f4a2dd952749122"
dependencies = [
"thiserror",
"ucd-trie",
@@ -80,7 +80,7 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.5.2"
+version = "2.5.7"
dependencies = [
"pest",
"pest_generator",
@@ -88,9 +88,9 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.5.2"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7"
+checksum = "e56094789873daa36164de2e822b3888c6ae4b4f9da555a1103587658c805b1e"
dependencies = [
"pest",
"pest_meta",
@@ -101,38 +101,38 @@ dependencies = [
[[package]]
name = "pest_meta"
-version = "2.5.2"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065"
+checksum = "6733073c7cff3d8459fda0e42f13a047870242aed8b509fe98000928975f359e"
dependencies = [
"once_cell",
"pest",
- "sha1",
+ "sha2",
]
[[package]]
name = "proc-macro2"
-version = "1.0.49"
+version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
+checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.23"
+version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
+checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
dependencies = [
"proc-macro2",
]
[[package]]
-name = "sha1"
-version = "0.10.5"
+name = "sha2"
+version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
+checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -141,9 +141,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "1.0.107"
+version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
+checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927"
dependencies = [
"proc-macro2",
"quote",
@@ -152,18 +152,18 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.38"
+version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
+checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.38"
+version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
+checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2",
"quote",
@@ -184,9 +184,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
[[package]]
name = "unicode-ident"
-version = "1.0.6"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
+checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "version_check"
diff --git a/vendor/pest_derive/Cargo.toml b/vendor/pest_derive/Cargo.toml
index df0a30325..124f815d1 100644
--- a/vendor/pest_derive/Cargo.toml
+++ b/vendor/pest_derive/Cargo.toml
@@ -13,7 +13,7 @@
edition = "2021"
rust-version = "1.56"
name = "pest_derive"
-version = "2.5.2"
+version = "2.5.7"
authors = ["DragoČ™ Tiselice <dragostiselice@gmail.com>"]
description = "pest's derive macro"
homepage = "https://pest.rs/"
@@ -34,11 +34,11 @@ name = "pest_derive"
proc-macro = true
[dependencies.pest]
-version = "2.5.2"
+version = "2.5.7"
default-features = false
[dependencies.pest_generator]
-version = "2.5.2"
+version = "2.5.7"
default-features = false
[features]
diff --git a/vendor/pest_derive/_README.md b/vendor/pest_derive/_README.md
index da30ab74e..cb8055eb0 100644
--- a/vendor/pest_derive/_README.md
+++ b/vendor/pest_derive/_README.md
@@ -167,6 +167,8 @@ mod b {
## Projects using pest
+You can find more projects and ecosystem tools in the [awesome-pest](https://github.com/pest-parser/awesome-pest) repo.
+
* [pest_meta](https://github.com/pest-parser/pest/blob/master/meta/src/grammar.pest) (bootstrapped)
* [AshPaper](https://github.com/shnewto/ashpaper)
* [brain](https://github.com/brain-lang/brain)
@@ -203,6 +205,29 @@ mod b {
This library should always compile with default features on **Rust 1.56.1**
or **Rust 1.61** with `const_prec_climber`.
+## no_std support
+
+The `pest` and `pest_derive` crates can be built without the Rust standard
+library and target embedded environments. To do so, you need to disable
+their default features. In your `Cargo.toml`, you can specify it as follows:
+
+```toml
+[dependencies]
+# ...
+pest = { version = "2", default-features = false }
+pest_derive = { version = "2", default-features = false }
+```
+
+If you want to build these crates in the pest repository's workspace, you can
+pass the `--no-default-features` flag to `cargo` and specify these crates using
+the `--package` (`-p`) flag. For example:
+
+```bash
+$ cargo build --target thumbv7em-none-eabihf --no-default-features -p pest
+$ cargo bootstrap
+$ cargo build --target thumbv7em-none-eabihf --no-default-features -p pest_derive
+```
+
## Special thanks
A special round of applause goes to prof. Marius Minea for his guidance and all
diff --git a/vendor/pest_derive/examples/base.pest b/vendor/pest_derive/examples/base.pest
new file mode 100644
index 000000000..c63d48af1
--- /dev/null
+++ b/vendor/pest_derive/examples/base.pest
@@ -0,0 +1,2 @@
+WHITESPACE = _{ " " | "\t" | NEWLINE }
+int = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) } \ No newline at end of file
diff --git a/vendor/pest_derive/examples/calc.pest b/vendor/pest_derive/examples/calc.pest
index 9f2cc3b74..383497391 100644
--- a/vendor/pest_derive/examples/calc.pest
+++ b/vendor/pest_derive/examples/calc.pest
@@ -1,5 +1,3 @@
-WHITESPACE = _{ " " | "\t" | NEWLINE }
-
program = { SOI ~ expr ~ EOI }
expr = { prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix* )* }
infix = _{ add | sub | mul | div | pow }
@@ -12,5 +10,4 @@ WHITESPACE = _{ " " | "\t" | NEWLINE }
neg = { "-" } // Negation
postfix = _{ fac }
fac = { "!" } // Factorial
- primary = _{ int | "(" ~ expr ~ ")" }
- int = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) } \ No newline at end of file
+ primary = _{ int | "(" ~ expr ~ ")" } \ No newline at end of file
diff --git a/vendor/pest_derive/examples/calc.rs b/vendor/pest_derive/examples/calc.rs
index efc6b7b22..707162536 100644
--- a/vendor/pest_derive/examples/calc.rs
+++ b/vendor/pest_derive/examples/calc.rs
@@ -2,6 +2,7 @@ mod parser {
use pest_derive::Parser;
#[derive(Parser)]
+ #[grammar = "../examples/base.pest"]
#[grammar = "../examples/calc.pest"]
pub struct Parser;
}
diff --git a/vendor/pest_derive/tests/implicit.pest b/vendor/pest_derive/tests/implicit.pest
new file mode 100644
index 000000000..18ebf7eaf
--- /dev/null
+++ b/vendor/pest_derive/tests/implicit.pest
@@ -0,0 +1,14 @@
+program = _{ SOI ~ implicit ~ EOI }
+implicit= ${ or ~ (WHITESPACE+ ~ or )* }
+
+or = !{ and ~ (or_op ~ and)+ | and }
+and = { comp ~ (and_op ~ comp)+ | comp }
+comp = { array ~ eq_op ~ array | array }
+
+array = ${ term }
+
+term = _{ ASCII_ALPHANUMERIC+ }
+or_op = { "||" }
+and_op = { "&&" }
+eq_op = { "=" }
+WHITESPACE = _{ " " | "\t" | NEWLINE } \ No newline at end of file
diff --git a/vendor/pest_derive/tests/implicit.rs b/vendor/pest_derive/tests/implicit.rs
new file mode 100644
index 000000000..8ad5a7e6a
--- /dev/null
+++ b/vendor/pest_derive/tests/implicit.rs
@@ -0,0 +1,25 @@
+// Licensed under the Apache License, Version 2.0
+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
+// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. All files in the project carrying such notice may not be copied,
+// modified, or distributed except according to those terms.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+extern crate alloc;
+extern crate pest;
+extern crate pest_derive;
+
+use pest::Parser;
+use pest_derive::Parser;
+
+#[derive(Parser)]
+#[grammar = "../tests/implicit.pest"]
+struct TestImplicitParser;
+
+#[test]
+fn test_implicit_whitespace() {
+ // this failed to parse due to a bug in the optimizer
+ // see: https://github.com/pest-parser/pest/issues/762#issuecomment-1375374868
+ let successful_parse = TestImplicitParser::parse(Rule::program, "a a");
+ assert!(successful_parse.is_ok());
+}