Release v0.1.0 (Basic State Machine)
📰 See more on the Release Article
Changes:
Supported Format
🗹 XState
Syntax
🗹 Support both //line
and /*block*/
comments
🗹 If not quoted, state and event name must be in PascalCase
🗹 Supported quotes: single-quote '
, double-quote "
, backtick `
🗹 Only names quoted with backtick will support newline
🗹 Any pre-defined symbol support both direction, either left or right. For example:
On -> Off @ Toggle
On <- Off @ Toggle
- Some symbol can be used for break-line. For example:
/*
bunch of expressions
*/
Z ---------------------------> A @ Reset
🗹 Transient transition
"get🆙" -> Walk
🗹 Eventful/Triggered transition
On -> Off @ Shutdown
CLI
🗹 Transpile or Generate to others format
The essential feature of many compiler/transpiler is to output the result. In scrap code
command, the output is base on --format
flag as long as there is no syntax or semantic error. By default, it parses the whole file and outputs it as an XState format (in JSON). To parse it line-by-line, you need to provide --stream
flag which also gives you the partial results.
🗹 REPL
This is for the sake of prototyping and quickly evaluate some expressions. This REPL subcommand is also pipe friendly just like scrap code
. The only differences are it always outputs line numbers when running on the interactive shell. It also can receive input from stdin
when piped.