From 704a228cb4c54d740057308ba3b1c826bb62ed82 Mon Sep 17 00:00:00 2001 From: Yoshinori Tanimura Date: Sat, 25 Mar 2023 09:13:34 +0900 Subject: [PATCH 1/3] cargo upgrade --- espr-derive/Cargo.toml | 8 ++++---- espr/Cargo.toml | 18 +++++++++--------- espr/src/codegen/rust/entity.rs | 13 ++++++++----- espr/src/codegen/rust/schema.rs | 4 ++-- ruststep-derive/Cargo.toml | 14 +++++++------- ruststep-derive/src/common.rs | 4 ++-- ruststep-derive/src/holder_attr.rs | 2 +- ruststep/Cargo.toml | 10 +++++----- 8 files changed, 38 insertions(+), 35 deletions(-) diff --git a/espr-derive/Cargo.toml b/espr-derive/Cargo.toml index 5b60f2c11..19142a02e 100644 --- a/espr-derive/Cargo.toml +++ b/espr-derive/Cargo.toml @@ -16,9 +16,9 @@ categories = ["science", "development-tools"] proc-macro = true [dependencies] -quote = "1.0.17" -proc-macro2 = "1.0.37" -syn = { version = "1.0.91", features = ["full", "extra-traits"] } +quote = "1.0.26" +proc-macro2 = "1.0.53" +syn = { version = "2.0.9", features = ["full", "extra-traits"] } [dependencies.espr] version = "0.3.0" @@ -27,5 +27,5 @@ path = "../espr" [dev-dependencies] ruststep = { version = "0.3.0", path = "../ruststep" } ruststep-derive = { version = "0.3.0", path = "../ruststep-derive" } -serde = "1.0.136" +serde = "1.0.158" derive-new = "0.5.9" diff --git a/espr/Cargo.toml b/espr/Cargo.toml index 2baf84321..719362145 100644 --- a/espr/Cargo.toml +++ b/espr/Cargo.toml @@ -15,23 +15,23 @@ categories = ["science", "development-tools"] [dependencies] # For parser -nom = "7.1.1" +nom = "7.1.3" # For Rust code generation -syn = "1.0.91" -quote = "1.0.17" -proc-macro2 = "1.0.37" +syn = "2.0.9" +quote = "1.0.26" +proc-macro2 = "1.0.53" # Utilities Inflector = "0.11.4" derive_more = "0.99.17" -itertools = "0.10.3" +itertools = "0.10.5" maplit = "1.0.2" -thiserror = "1.0.30" +thiserror = "1.0.40" structopt = "0.3.26" -check_keyword = "0.1.1" -katexit = "0.1.2" +check_keyword = "0.2.0" +katexit = "0.1.4" [dev-dependencies] -insta = "1.14.0" +insta = "1.29.0" maplit = "1.0.2" diff --git a/espr/src/codegen/rust/entity.rs b/espr/src/codegen/rust/entity.rs index 643bd0b00..d96812720 100644 --- a/espr/src/codegen/rust/entity.rs +++ b/espr/src/codegen/rust/entity.rs @@ -34,7 +34,7 @@ impl From for Field { fn from(attr: EntityAttribute) -> Self { let EntityAttribute { name, ty, optional } = attr; - let name = format_ident!("{}", name.to_safe()); + let name = format_ident!("{}", name.into_safe()); let attributes = if use_place_holder(&ty) { vec![parse_quote! { #[holder(use_place_holder)] }] } else { @@ -83,14 +83,14 @@ impl Entity { /// Field identifier fn field_ident(&self) -> syn::Ident { - format_ident!("{}", self.name.to_safe()) + format_ident!("{}", self.name.as_str().into_safe()) } /// Generate declaration of `XxxAny` enum fn generate_any_enum(&self, tokens: &mut TokenStream) { let any = self.any_ident(); - let mut fields = vec![format_ident!("{}", self.name.to_safe())]; + let mut fields = vec![format_ident!("{}", self.name.as_str().into_safe())]; let mut variants = vec![format_ident!("{}", self.name.to_pascal_case())]; let mut constraints = vec![format_ident!("{}", self.name.to_pascal_case())]; @@ -99,7 +99,7 @@ impl Entity { TypeRef::Entity { name, is_supertype, .. } => { - fields.push(format_ident!("{}", name.to_safe())); + fields.push(format_ident!("{}", name.as_str().into_safe())); variants.push(format_ident!("{}", name.to_pascal_case())); if *is_supertype { constraints.push(format_ident!("{}Any", name.to_pascal_case())); @@ -216,7 +216,10 @@ impl Entity { let (name, ty) = match ty { TypeRef::Named { name, .. } | TypeRef::Entity { name, .. } => { let ty = format_ident!("{}", name.to_pascal_case()); - (format_ident!("{}", name.to_safe()), parse_quote! { #ty }) + ( + format_ident!("{}", name.as_str().into_safe()), + parse_quote! { #ty }, + ) } _ => unreachable!(), }; diff --git a/espr/src/codegen/rust/schema.rs b/espr/src/codegen/rust/schema.rs index e9db73a87..33bd6e846 100644 --- a/espr/src/codegen/rust/schema.rs +++ b/espr/src/codegen/rust/schema.rs @@ -51,11 +51,11 @@ impl Schema { .collect(); let holder_name: Vec<_> = entities .iter() - .map(|e| format_ident!("{}", e.name.to_safe())) + .map(|e| format_ident!("{}", e.name.as_str().into_safe())) .chain( type_decls .clone() - .map(|e| format_ident!("{}", e.id().to_safe())), + .map(|e| format_ident!("{}", e.id().into_safe())), ) .collect(); let holders_name: Vec<_> = entities diff --git a/ruststep-derive/Cargo.toml b/ruststep-derive/Cargo.toml index e74d43ac1..a94558cbd 100644 --- a/ruststep-derive/Cargo.toml +++ b/ruststep-derive/Cargo.toml @@ -17,17 +17,17 @@ categories = ["science", "development-tools"] proc-macro = true [dependencies] -quote = "1.0.17" -proc-macro2 = "1.0.37" -syn = { version = "1.0.91", features = ["full", "extra-traits"] } -proc-macro-crate = "1.1.3" +quote = "1.0.26" +proc-macro2 = "1.0.53" +syn = { version = "2.0.9", features = ["full", "extra-traits"] } +proc-macro-crate = "1.3.1" Inflector = "0.11.4" proc-macro-error = "1.0.4" [dev-dependencies] -serde = "1.0.136" -trybuild = "1.0.59" -insta = "1.14.0" +serde = "1.0.158" +trybuild = "1.0.80" +insta = "1.29.0" [dev-dependencies.ruststep] path = "../ruststep" diff --git a/ruststep-derive/src/common.rs b/ruststep-derive/src/common.rs index 584b22186..3125091ae 100644 --- a/ruststep-derive/src/common.rs +++ b/ruststep-derive/src/common.rs @@ -52,7 +52,7 @@ pub fn ruststep_crate() -> syn::Path { arguments: syn::PathArguments::None, }); syn::Path { - leading_colon: Some(syn::token::Colon2::default()), + leading_colon: Some(syn::token::PathSep::default()), segments, } } @@ -75,7 +75,7 @@ pub fn ruststep_crate() -> syn::Path { arguments: syn::PathArguments::None, }); syn::Path { - leading_colon: Some(syn::token::Colon2::default()), + leading_colon: Some(syn::token::PathSep::default()), segments, } } diff --git a/ruststep-derive/src/holder_attr.rs b/ruststep-derive/src/holder_attr.rs index 337d303a5..8d409a9b4 100644 --- a/ruststep-derive/src/holder_attr.rs +++ b/ruststep-derive/src/holder_attr.rs @@ -25,7 +25,7 @@ impl HolderAttr { for attr in attrs { // Only read `#[holder(...)]` - if let Some(ident) = attr.path.get_ident() { + if let Some(ident) = attr.meta.path().get_ident() { if ident != "holder" { continue; } diff --git a/ruststep/Cargo.toml b/ruststep/Cargo.toml index d94dd61e2..fed5e0e6f 100644 --- a/ruststep/Cargo.toml +++ b/ruststep/Cargo.toml @@ -21,18 +21,18 @@ ap203 = [] [dependencies] derive_more = "0.99.17" derive-new = "0.5.9" -nom = "7.1.1" -serde = { version = "1.0.136", features = ["derive"] } -thiserror = "1.0.30" +nom = "7.1.3" +serde = { version = "1.0.158", features = ["derive"] } +thiserror = "1.0.40" Inflector = "0.11.4" -itertools = "0.10.3" +itertools = "0.10.5" [dependencies.ruststep-derive] path = "../ruststep-derive" version = "0.3.0" [dev-dependencies] -anyhow = "1.0.56" +anyhow = "1.0.70" maplit = "1.0.2" [dev-dependencies.espr-derive] From 88305e969f356f7ba1e05fc2a388bbf84445680d Mon Sep 17 00:00:00 2001 From: Yoshinori Tanimura Date: Sat, 25 Mar 2023 09:26:56 +0900 Subject: [PATCH 2/3] Updates CHANGELOG --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f2616d9e..d69379422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,17 +15,18 @@ In addition to original Keep-a-Changelog, we use following rules: ## Unreleased ### Added -- Deserialize `LOGICAL` and `BOOLEAN` by `.T.`, `.F.`, and `.U.` notations. +- Deserialize `LOGICAL` and `BOOLEAN` by `.T.`, `.F.`, and `.U.` notations. https://github.com/ricosjp/ruststep/pull/231 ### Changed -- Remove `field` attr from enumerations. -- Recursive `get_owned` for select type without boxed variant. +- Remove `field` attr from enumerations. https://github.com/ricosjp/ruststep/pull/233 +- Recursive `get_owned` for select type without boxed variant. https://github.com/ricosjp/ruststep/pull/234 ### Fixed -- Deseialize `Option::Some`. -- Recursive implementation of `ruststep::tables::EntityTable::{get_owned, owned_iter}` for select types. +- Deseialize `Option::Some`. https://github.com/ricosjp/ruststep/pull/232 +- Recursive implementation of `ruststep::tables::EntityTable::{get_owned, owned_iter}` for select types. https://github.com/ricosjp/ruststep/pull/230 ### Internal +- `cargo upgrade --workspace` https://github.com/ricosjp/ruststep/pull/240 ## 0.3.0 - 2022-06-14 From 484f15967bfe3ade067c8b4b9e2937df4ad08903 Mon Sep 17 00:00:00 2001 From: Yoshinori Tanimura Date: Sat, 25 Mar 2023 09:38:33 +0900 Subject: [PATCH 3/3] downgrade proc-macro-crate --- ruststep-derive/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruststep-derive/Cargo.toml b/ruststep-derive/Cargo.toml index a94558cbd..0a94ce980 100644 --- a/ruststep-derive/Cargo.toml +++ b/ruststep-derive/Cargo.toml @@ -20,7 +20,7 @@ proc-macro = true quote = "1.0.26" proc-macro2 = "1.0.53" syn = { version = "2.0.9", features = ["full", "extra-traits"] } -proc-macro-crate = "1.3.1" +proc-macro-crate = "1.2.1" Inflector = "0.11.4" proc-macro-error = "1.0.4"