commit | fa8ea06894e99ba860e7d00476a2bb97b60ab5d4 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Mar 10 04:19:04 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Fri Mar 10 04:19:04 2023 +0000 |
tree | f7c7d4823a905b00d14ee39cb4477f5c16d85d12 | |
parent | eb95df0cf476f8304ae166829075e8c6ac911119 [diff] | |
parent | b99202a0b6a445027b87944c84337c995dccb94e [diff] |
Snap for 9719949 from 7daa1d2b8e60aebb87dd835cd21ac2687a14f10b to udc-release am: b99202a0b6 Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/shlex/+/21946844 Change-Id: I7dbe4a7f812800fc19d2f2df519711f3ce5fcd74 Signed-off-by: Automerger Merge Worker <[email protected]>
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: 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.
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.
The source code in this repository is Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.