diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/shlex | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/shlex')
-rw-r--r-- | vendor/shlex/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/shlex/CHANGELOG.md | 17 | ||||
-rw-r--r-- | vendor/shlex/Cargo.toml | 9 | ||||
-rw-r--r-- | vendor/shlex/README.md | 11 | ||||
-rw-r--r-- | vendor/shlex/src/lib.rs | 26 |
5 files changed, 52 insertions, 13 deletions
diff --git a/vendor/shlex/.cargo-checksum.json b/vendor/shlex/.cargo-checksum.json index adc7cf482..4d8a364a9 100644 --- a/vendor/shlex/.cargo-checksum.json +++ b/vendor/shlex/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"edca385717f4ebff8f4f9580f308e7c4ebe12d8766f0ae231fa73bfae854d4d4","LICENSE-APACHE":"553fffcd9b1cb158bc3e9edc35da85ca5c3b3d7d2e61c883ebcfa8a65814b583","LICENSE-MIT":"4455bf75a91154108304cb283e0fea9948c14f13e20d60887cf2552449dea3b1","README.md":"7cfea9ea02a6dac58dd7da5be42fe2be689d0e766e1288c16fc9d2741f6ead85","src/lib.rs":"ae9747e0e2f5dbdd1443590a7344c18a3f1cd0618b44377798e0bc2f43d52f98"},"package":"42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"ae8160bce335d8cb67f0d522402ed7bdb47266ca774d2ba3edc661783c86bbbe","Cargo.toml":"cdc548ec58d7bcee2494dcab1de5996cdfc748622d685e1cf74a50d54edbdf34","LICENSE-APACHE":"553fffcd9b1cb158bc3e9edc35da85ca5c3b3d7d2e61c883ebcfa8a65814b583","LICENSE-MIT":"4455bf75a91154108304cb283e0fea9948c14f13e20d60887cf2552449dea3b1","README.md":"7b378c1f3f7a3c7a8a819a736a43aa6e5d984d11b412224ef25597dd1ae2fac2","src/lib.rs":"1a3880eb7688af89736e52de8deac316698e664b8b1b64f80c346bf79b18f8b8"},"package":"43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"}
\ No newline at end of file diff --git a/vendor/shlex/CHANGELOG.md b/vendor/shlex/CHANGELOG.md new file mode 100644 index 000000000..50d2e6e0d --- /dev/null +++ b/vendor/shlex/CHANGELOG.md @@ -0,0 +1,17 @@ +# 1.1.0 + +* Adds the `std` feature (enabled by default) +* Disabling the `std` feature makes the crate work in `#![no_std]` mode, assuming presence of the `alloc` crate + +# 1.0.0 + +* Adds the `join` convenience function. +* Fixes parsing of `'\\n'` to match the behavior of bash/Zsh/Python `shlex`. The result was previously `\n`, now it is `\\n`. + +# 0.1.1 + +* Adds handling of `#` comments. + +# 0.1.0 + +This is the initial release. diff --git a/vendor/shlex/Cargo.toml b/vendor/shlex/Cargo.toml index 4ac947e48..2741ed866 100644 --- a/vendor/shlex/Cargo.toml +++ b/vendor/shlex/Cargo.toml @@ -12,8 +12,13 @@ [package] name = "shlex" -version = "1.0.0" +version = "1.1.0" authors = ["comex <comexk@gmail.com>", "Fenhl <fenhl@fenhl.net>"] -description = "Split a string into shell words, like Python's shlex.\n" +description = "Split a string into shell words, like Python's shlex." +categories = ["command-line-interface", "parser-implementations"] license = "MIT OR Apache-2.0" repository = "https://github.com/comex/rust-shlex" + +[features] +default = ["std"] +std = [] diff --git a/vendor/shlex/README.md b/vendor/shlex/README.md index dad0ae1ae..6778828bd 100644 --- a/vendor/shlex/README.md +++ b/vendor/shlex/README.md @@ -3,7 +3,7 @@ Same idea as (but implementation not directly based on) the Python shlex module. However, this implementation does not support any of the Python module's customization because it makes parsing slower and is fairly useless. You only get the default settings of shlex.split, which mimic the POSIX shell: -http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html +<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html> This implementation also deviates from the Python version in not treating \r specially, which I believe is more compliant. @@ -11,12 +11,17 @@ specially, which I believe is more compliant. The algorithms in this crate are oblivious to UTF-8 high bytes, so they iterate over the bytes directly as a micro-optimization. +Disabling the `std` feature (which is enabled by default) will allow the crate +to work in `no_std` environments, where the `alloc` crate, and a global +allocator, are available. + # LICENSE + The source code in this repository is Licensed under either of - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or - http://www.apache.org/licenses/LICENSE-2.0) + https://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or - http://opensource.org/licenses/MIT) + https://opensource.org/licenses/MIT) at your option. diff --git a/vendor/shlex/src/lib.rs b/vendor/shlex/src/lib.rs index 6e0639589..31b54bda6 100644 --- a/vendor/shlex/src/lib.rs +++ b/vendor/shlex/src/lib.rs @@ -1,26 +1,38 @@ // Copyright 2015 Nicholas Allegra (comex). -// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or -// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be +// Licensed under the Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> or +// the MIT license <https://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. //! Same idea as (but implementation not directly based on) the Python shlex module. However, this //! implementation does not support any of the Python module's customization because it makes //! parsing slower and is fairly useless. You only get the default settings of shlex.split, which //! mimic the POSIX shell: -//! http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html +//! <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html> //! -//! This implementation also deviates from the Python version in not treating \r specially, which I -//! believe is more compliant. +//! This implementation also deviates from the Python version in not treating `\r` specially, which +//! I believe is more compliant. //! //! The algorithms in this crate are oblivious to UTF-8 high bytes, so they iterate over the bytes //! directly as a micro-optimization. +//! +//! Disabling the `std` feature (which is enabled by default) will allow the crate to work in +//! `no_std` environments, where the `alloc` crate, and a global allocator, are available. + +#![cfg_attr(not(feature = "std"), no_std)] -use std::borrow::Cow; +extern crate alloc; +use alloc::vec::Vec; +use alloc::borrow::Cow; +use alloc::string::String; +#[cfg(test)] +use alloc::vec; +#[cfg(test)] +use alloc::borrow::ToOwned; /// An iterator that takes an input string and splits it into the words using the same syntax as /// the POSIX shell. pub struct Shlex<'a> { - in_iter: std::str::Bytes<'a>, + in_iter: core::str::Bytes<'a>, /// The number of newlines read so far, plus one. pub line_no: usize, /// An input string is erroneous if it ends while inside a quotation or right after an |