Skip to content

Frame v0.6.0

Choose a tag to compare

@walkie walkie released this 30 Sep 17:51
· 557 commits to main since this release
7e0a062

This release includes a lot of work on the Rust back-end:

  • New feature: the current state of the machine is stored as a value of a simple enum type, which can be accessed to determine the state of a running machine.

  • New feature: a new follow_rust_naming feature option has been added and enabled by default. This option significantly improves the conformance of generated code with Rust naming conventions and style guidelines.

  • New feature: a new generate_hook_methods feature option has been added that generates methods that are invoked on each transition or change-state. The names of these methods can be configured via config.yaml.

  • Completed feature: hierarchical state machines. This enables defining states as children of other states. Event handlers on child states may defer to the corresponding handler on a parent state by terminating the child handler with the "continue" terminator :>. The parent handler will be immediately invoked after a child handler that terminates in :>, if the child handler does not otherwise transition or return.

  • Completed feature: change-state transitions. Change-states (->>) are transitions that do not trigger the usual exit/enter events. Previously, this feature only worked for simple states (states without variables, parameters, or enter event arguments). Now it works in all expected scenarios.

  • Completed feature: state stacks/history. This feature enables pushing states (with corresponding state variables and arguments) to a stack. These states can later be returned to by a "pop transition" using the syntax -> $$[-]. This pops a state from the stack and restores the machine to that state.

  • Refactors and simplifies the generated code, particularly the representation of states and the initialization of state contexts.

  • More names in the generated code are now customizable via the config.yaml interface.

  • Significantly improved test coverage and corresponding bug fixes:

    • Initial states are now initialized correctly and may contain state variables and enter parameters.
    • Transitions inside of match or conditional statements now terminate the execution of a handler.
    • Negated conditional statements (?!) now work as expected.
    • ... and many more!