Repository navigation
Releases
Add Clone impls for NestedList and NestedDict
Now requires the syn/clone-impls feature (which is on by default).
Added
- Add
Cloneimpl toparse::Bracedwrapper (llwxntnt) - Derive
Cloneimpls forNestedListandNestedDict(nsysprpp)
Changed
- Require
syn/clone-implsfeature, needed forCloneimpls forNestedList(among others) (qozqwmmk)- This is turned on in the default syn features, so shouldn't add any compile time in the common case.
Add Braced parse wrapper
Added
- Add
Bracedwrapper, which parses an item surrounded by braces{ }(mpnuopmt)
Fix span of missing argument errors in nested structs.
With the assistance of Claude Code, this release includes many other fixes and cleanups.
Added
- Implement
DebugforNestedDict(kwsztwtm) - Implement
DefaultforNestedDict, allowing use with#[kwarg(optional)](xlmlvnwn)
Changed
- Declare minimum supported rust version of 1.71 (mrvqwsux)
- This is the oldest version that syn v3 supports.
- Relicense from MIT to
MIT OR Apache-2.0(kxrrqpts)- Since the MIT license is still an option, this change actually makes licensing more permissive.
- Require the exact matching version of
macro-kwargs-derive(ultltztn)- Generated code relies on internal APIs, so mismatched versions could fail to compile.
- Reject integer and float literals whose suffix doesn't match the target type (sovtoywz)
- For example,
5i64can no longer be parsed as au8. Unsuffixed literals are unaffected. - This is technically a breaking change, but any code that relied on the prior behavior was buggy.
- For example,
Fixed
- Fix span of missing argument errors in nested structs (pnrqmzup)
- Avoid redundant_field_names lint in generated code (nvqqkunl)
- Fix
#[kwarg(with_func = "...")], which previously failed to compile as the function wasn't properly called (movmzuok) - Generated code no longer requires a direct dependency on
synorproc-macro2(vlkusror) - Fix
parse_macro_arg_via_syn!when invoked by path or withoutsynin scope (ossnuvpr) - Point
ExplicitOptionparse errors at the unexpected identifier instead of the token after it (sxzzzyzv) - Allow fields named
argument_listormissing_argument_errors, which clashed with locals in generated code (vrtqvqnq) - Reject fields with duplicate argument names (via
rename), which previously made one of them impossible to set (owonzqoy) - Fields with raw names like
r#typenow take the argumenttypeinstead ofr#type; both spellings are accepted (zunuotso) NestedDictreports every duplicate key, instead of stopping at the first one (xuuxssvv)- Correct the docs for
ParsedKeywordArgumentsordering: arguments are in the order the user wrote them, not the order the fields are declared in (rwmympok)- This was already the actual behavior; only the documentation was wrong.
- Allow a trailing comma in
#[kwarg(...)], like#[kwarg(optional,)](xwwsquxv) - Fix derive failing on fields whose names differ only in case or underscores, like
foo_barandfoo__bar(loplrtmk)- Avoid
non_snake_casewarnings in generated code for fields that aren't snake case.
- Avoid
- Reject generic structs in the derive with a clear error, instead of failing with confusing errors in generated code (klptmunk)
Rename crate to macro-kwargs
Changes
- BIG: Rename crate from
proc-macro-kwargstomacro-kwargs. (ltmmqrrp)- Crate with old name has been marked
#[deprecated(...)]in v0.3.1 and will receive no further updates. - This crate's versions start off where
proc-macro-kwargsended.
- Crate with old name has been marked
NOTE: The crate has no v0.3.2 version, neither under the old crate name nor the new one.
I originally meant to publish change rmnzyzlo (commit 4b51166) as v0.3.2,
but I accidentally published it as v0.3.3 on crates.io and messed up the CHANGELOG.
Since crates.io releases are immutable, I stuck with v0.3.3 as the version number for the release.
Warn about impending rename to `macro-kwargs`.
Changes
- WARNING: Impending rename from
proc-macro-kwargstomacro-kwargs.
The crate has been marked deprecated in favor of its new name.
The crate under the old name will receive no further updates.
Update to syn v3
Changes
- BREAKING: Update to syn v3 (nzzxxmyz)
Add a #[kwarg(with_syn)] attribute
Added
- Support a
#[kwarg(with_syn)]shorthand to parse viasyn::Parseinstead ofMacroArg(smwonvvz)- More concise than using the
proc_macro_kwargs::parse::Synwrapper type (which doesn't even support#[kwarg(with_wrapper)]) - Also available through the
#[kwarg(syn)]shorthand
- More concise than using the
Support stable rust
Removes use of #[feature(trait_alias)],
allowing program to compile on stable rust in addition to nightly.
Upgrade heck from 0.4 to 0.5.
Upgrade to syn v2
Requires minor version bump for semver compatibility.
This is an alpha version because it removes impl MacroArg for NestedMeta,
At the time, I didn't know what the syn v2 replacement for NestedMeta is.
Fix "useless question mark" warning in derived code
Add #[automatically_derived] to the generated trait impls.
Implement From<T> for Syn<T>.
Cannot add From<Syn<T>> for T due to coherence rules.