aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2023-02-02 22:21:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-02-02 22:21:17 +0000
commit6d6982abe5e05fbf5a7581ddb020e756c126420f (patch)
tree5dd052176f1219e66527f57d2d4847fd28cbdb5d
parented82b2c0b01e9a2360f10c63c34a0651a5c95c50 (diff)
parent1e1e6f4198e7dd8c7e1ceeda523b491b197adf9e (diff)
downloaddocument-features-6d6982abe5e05fbf5a7581ddb020e756c126420f.tar.gz
Upgrade document-features to 0.2.7 am: 86001b3c86 am: 959213af96 am: 1e1e6f4198
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/document-features/+/2417172 Change-Id: Icc1d7b03dfb16002fcc85f6d57a6e61b6d385b25 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp4
-rw-r--r--CHANGELOG.md4
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA15
-rw-r--r--lib.rs22
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
diff --git a/Android.bp b/Android.bp
index 851475d..c5a14fd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -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
diff --git a/Cargo.toml b/Cargo.toml
index 1dd548f..e7d6d33 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/METADATA b/METADATA
index 97a3f00..17e591a 100644
--- a/METADATA
+++ b/METADATA
@@ -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
}
}
diff --git a/lib.rs b/lib.rs
index 37e7ea4..5ce0b50 100644
--- a/lib.rs
+++ b/lib.rs
@@ -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 = {