diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2023-02-02 21:38:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-02-02 21:38:51 +0000 |
commit | 1e1e6f4198e7dd8c7e1ceeda523b491b197adf9e (patch) | |
tree | 5dd052176f1219e66527f57d2d4847fd28cbdb5d | |
parent | d05e26903e8f0398db6cc90df4300f7bc727c53c (diff) | |
parent | 959213af96b930e28361394091301863cb360626 (diff) | |
download | document-features-1e1e6f4198e7dd8c7e1ceeda523b491b197adf9e.tar.gz |
Upgrade document-features to 0.2.7 am: 86001b3c86 am: 959213af96
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/document-features/+/2417172
Change-Id: I1bca5902ad6bc67864cabbc963b70d2c8ab42357
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 15 | ||||
-rw-r--r-- | lib.rs | 22 |
7 files changed, 30 insertions, 21 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 1cb9fc2..2cc8384 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "ba20128b81382fdb40cfbf7aff2c6408a066c236" + "sha1": "2f77c4e102d4546eb4a2291b396ed39c4533df1d" }, "path_in_vcs": "" }
\ No newline at end of file @@ -1,8 +1,6 @@ // This file is generated by cargo2android.py --config cargo2android.json. // Do not modify this file as changes will be overridden on upgrade. - - package { default_applicable_licenses: [ "external_rust_crates_document-features_license", @@ -45,7 +43,7 @@ rust_proc_macro { name: "libdocument_features", crate_name: "document_features", cargo_env_compat: true, - cargo_pkg_version: "0.2.6", + cargo_pkg_version: "0.2.7", srcs: ["lib.rs"], edition: "2018", features: ["default"], diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a1c31..aa4f453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.7 - 2002-12-21 + +* Fix parsing of Cargo.toml with multi-line array of array (#16) + ## 0.2.6 - 2022-09-24 * Fix parsing of escaped string literal in the macro arguments @@ -12,7 +12,7 @@ [package] edition = "2018" name = "document-features" -version = "0.2.6" +version = "0.2.7" authors = ["Slint Developers <info@slint-ui.com>"] description = "Extract documentation for the feature flags from comments in Cargo.toml" homepage = "https://slint-ui.com" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 0c75769..c4ba7a9 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -3,7 +3,7 @@ [package] name = "document-features" -version = "0.2.6" +version = "0.2.7" authors = ["Slint Developers <info@slint-ui.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -1,3 +1,7 @@ +# This project was upgraded with external_updater. +# Usage: tools/external_updater/updater.sh update rust/crates/document-features +# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md + name: "document-features" description: "Extract documentation for the feature flags from comments in Cargo.toml" third_party { @@ -7,14 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/document-features/document-features-0.2.6.crate" + value: "https://static.crates.io/crates/document-features/document-features-0.2.7.crate" } - version: "0.2.6" - # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same. + version: "0.2.7" license_type: NOTICE last_upgrade_date { - year: 2022 - month: 10 - day: 27 + year: 2023 + month: 2 + day: 1 } } @@ -319,13 +319,8 @@ fn process_toml(cargo_toml: &str, args: &Args) -> Result<String, String> { } } else if let Some((dep, rest)) = line.split_once("=") { let dep = dep.trim().trim_matches('"'); - // Don't call `get_balanced` if we are not in features or a dependency table - let rest = if current_table == "features" || current_table.ends_with("dependencies") { - get_balanced(rest, &mut lines) - .map_err(|e| format!("Parse error while parsing dependency {}: {}", dep, e))? - } else { - Cow::from(rest) - }; + let rest = get_balanced(rest, &mut lines) + .map_err(|e| format!("Parse error while parsing value {}: {}", dep, e))?; if current_table == "features" && dep == "default" { let defaults = rest .trim() @@ -424,6 +419,7 @@ fn get_balanced<'a>( } } else { match b { + b'\\' => last_slash = true, b'"' => in_quote = true, b'{' | b'[' => level += 1, b'}' | b']' if level == 0 => return Err("unbalanced source".into()), @@ -666,7 +662,7 @@ default = [ #ffff # ff "#, - "Parse error while parsing dependency default", + "Parse error while parsing value default", ); } @@ -679,7 +675,7 @@ default = [ foo = [ x = { ] bar = [] "#, - "Parse error while parsing dependency foo", + "Parse error while parsing value foo", ); } @@ -802,6 +798,14 @@ optional = true #[test] fn multi_lines() { let toml = r#" +[package.metadata.foo] +ixyz = [ + ["array"], + [ + "of", + "arrays" + ] +] [dev-dependencies] ## dep1 dep1 = { |