Added support for variant-attributes, updated README to show the syntax - #23
Closed
philipp-haker wants to merge 2 commits into
Closed
Added support for variant-attributes, updated README to show the syntax#23philipp-haker wants to merge 2 commits into
philipp-haker wants to merge 2 commits into
Conversation
Owner
|
I am closing this in favor: #27 I decided to use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull Request would resolve #22.
It adds support for zero or more attributes on variants, contained in a
#[kinded(attr)]. For each of these a#[attr]will be created for the corresponding variant of the kind-enum.These Changes were made:
kinded_macros/src/moodels.rstheVariant-struct got a new fieldkinded_variant_attrsthat contains the attributes that should put on the variant of the kinde-enum.kinded_macros/src/parse.rsa function was created that parses the attributeskinded_macros/src/generate/kind_enum.rsthese attributes were written to the generated variants.test_suitea dependency forstrumwas added and a test was introduced. TheEnumMessagederive succeeds even if there are no attributes to configure it present. These attributes just change the returned values. As such the test will always compile, but fail if the variant attributes are not present.README.md(top-level) an example was added that creates small documentation for the kind-enum variants and derives Default for it.