Closed Tartasprint closed 1 month ago
The pull request introduces changes to the core/src/typed
module by adding the full_rule_struct
macro and several new traits to enhance the parsing framework's functionality. It also updates the Cargo.toml
files for both pest3_derive
and pest3_generator
to include new feature specifications. Furthermore, the invocation of the full_rule_struct
macro is modified in the generator/src/typed/generator.rs
file to reflect its new namespace, ensuring correct resolution in the updated context.
File Path | Change Summary |
---|---|
core/src/typed/mod.rs | Added public export of full_rule_struct . |
core/src/typed/traits.rs | - Added full_rule_struct macro. - Introduced PairContainer , EmptyPairContainer , PairTree , TypedParser , and NeverFailedTypedNode traits. - Implemented PairContainer for Option<T> and TypedNode for Option<T> . |
derive/Cargo.toml | Updated pest3_generator dependency to include meta feature in [dev-dependencies] . |
generator/Cargo.toml | Added [features] section with meta feature for pest3_generator . |
generator/src/typed/generator.rs | Updated macro invocation from full_rule_struct! to typed::full_rule_struct! . |
generator/src/types.rs | Added conditional compilation to pest function to support behavior based on the meta feature. |
generator/tests/expected.rs | Updated macro calls from ::pest3_core::full_rule_struct! to ::pest3_core::typed::full_rule_struct! for various rules. |
generator/tests/expected_import_inline.rs | Updated macro calls from ::pest3_core::full_rule_struct! to ::pest3_core::typed::full_rule_struct! for multiple rules. |
generator/tests/expected_json.rs | Updated macro calls from ::pest3_core::full_rule_struct! to ::pest3_core::typed::full_rule_struct! for various rules. |
generator/tests/expected_sample.rs | Updated macro calls from ::pest3_core::full_rule_struct! to ::pest3_core::typed::full_rule_struct! for multiple rules. |
pest3_core
, which directly relates to the modifications in the core/src/typed/traits.rs
file where the full_rule_struct
macro is defined and exported. This indicates a structural change in how types and macros are organized within the project, aligning with the updates made in the main PR.🐇 In the meadow where macros play,
A new friend joins us today.
full_rule_struct
leaps with glee,
Traits and features, oh so free!
With every hop, our code will grow,
In the garden of logic, watch it flow! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
fixes #7
Now a user has to put just one line in the dependencies:
In order to do that I have:
full_rule_struct
macro public (even to the user)meta
feature to the generator crate, so that I can activate it in the generator's tests.Summary by CodeRabbit
New Features
full_rule_struct
macro for enhanced parsing capabilities.PairContainer
,EmptyPairContainer
,PairTree
,TypedParser
, andNeverFailedTypedNode
for improved functionality in handling typed nodes and pairs.meta
feature in thepest3_generator
package.Bug Fixes
Documentation