Skip to content

Commit

Permalink
Small version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat-Lafon committed Sep 27, 2023
1 parent 107a4ed commit a03f604
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions hashconsing_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ edition = "2021"
proc-macro = true

[dependencies]
darling = "0.14.2"
proc-macro-error = "1.0.4"
darling = "0.20"
proc-macro-error = "1.0"
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
syn = { version = "2.0", features = ["full"] }
17 changes: 12 additions & 5 deletions hashconsing_derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use darling::{util::Flag, FromMeta, Result};
use darling::{ast::NestedMeta, util::Flag, Error, FromMeta, Result};
use proc_macro::{self, TokenStream};
use proc_macro2::Span;
use proc_macro_error::{abort_call_site, proc_macro_error};
use quote::{format_ident, quote};
use syn::{
parse_macro_input, punctuated::Punctuated, token::Paren, AttributeArgs, Data, DataEnum,
DeriveInput, Expr, ExprCall, ExprPath, FnArg, Pat, PatIdent, PatType, Path, PathArguments,
PathSegment, Token,
parse_macro_input, punctuated::Punctuated, token::Paren, Data, DataEnum, DeriveInput, Expr,
ExprCall, ExprPath, FnArg, Pat, PatIdent, PatType, Path, PathArguments, PathSegment,
Token,
};

#[derive(Debug, Default, FromMeta)]
Expand All @@ -32,7 +32,14 @@ impl MacroArgs {
#[proc_macro_attribute]
pub fn hcons(args: TokenStream, mut input: TokenStream) -> TokenStream {
let parsed_input = input.clone();
let attr_args = parse_macro_input!(args as AttributeArgs);

let attr_args = match NestedMeta::parse_meta_list(args.into()) {
Ok(v) => v,
Err(e) => {
return TokenStream::from(Error::from(e).write_errors());
}
};

let DeriveInput {
ident,
vis,
Expand Down

0 comments on commit a03f604

Please sign in to comment.