rustype / typestate-rs

Proc-macro typestate DSL for Rust
https://rustype.github.io/typestate-rs/
Apache License 2.0
141 stars 11 forks source link

The macro should be able to export diagrams even if the state machine fails verification #6

Open jmg-duarte opened 2 years ago

jmg-duarte commented 2 years ago

Having the machine export diagrams is a feature useful as documentation but also as a debugging tool. Allowing the macro to export diagrams before verification would help debugging

jmg-duarte commented 2 years ago

The problem starts here: https://github.com/rustype/typestate-rs/blob/9799ae1bccf46ef5039709d7b411833304491e88/typestate-proc-macro/src/lib.rs#L75-L91 While bailing early is useful to avoid processing malformed state machines, we still want to able to look at them, hence we must build them regardless and only run validations in the end.