Refactor workflow macro and enhance composite arm handling #3
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.
Summary
This PR introduces a significant refactoring of the
workflowmacro infloxide-macrosand related components. The primary goals of these changes are to improve code clarity, enhance type safety, and streamline the handling of edge definitions, particularly for composite arms.Key improvements include:
workflowmacro has been simplified by:floxide-macros-supportCrate: A new crate,floxide-macros-support, has been created to house shared data structures and parsing logic for the macros, promoting better code organization and reusability.retry.rsandlib.rshave been updated to reflect the latest API changes and best practices, including the use ofSharedState. The branching example now returns meaningful output.Changes by Crate
floxide-macrosworkflow.rs:WorkflowDef,EdgeKind, andCompositeArmtofloxide-macros-support.Cargo.toml:floxide-macros-supportas a dependency.trybuildas a dev-dependency for compile-fail tests.tests/compile_fail_tests.rswithtype_mismatch.rsUI test.tests/composite_arms.rsto test parsing of various composite arm syntaxes.tests/workflow.rsto reflect new syntax and remove unnecessary bindings in composite arms.floxide-macros-support(New Crate)WorkflowDef,EdgeKind,CompositeArm, and the associated parsing logic, extracted fromfloxide-macros/src/workflow.rs.examples/branching_example.rsStringto provide more meaningful return values._) where bindings are not needed.src/lib.rsSharedStatefor the context and reflect changes in node output types.Detailed Commit History
floxide-macros-support.retry.rsdoc example.lib.rsexample withSharedStateandNode.type_mismatch.rscompile-fail test.BatchAction::Smallparameter handling.floxide-macros-supportdependency.Cargo.lock.trybuilddev-dependency.composite_arms.rstests.floxide-macros-supportcrate.floxide-macros.This refactoring aims to make the workflow definition more robust, easier to understand, and less error-prone.