Frame v0.6.0
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_namingfeature 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_methodsfeature option has been added that generates methods that are invoked on each transition or change-state. The names of these methods can be configured viaconfig.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.yamlinterface. -
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!