Skip to content

Release v0.2.0 (Syntax Sugar)

Latest
Compare
Choose a tag to compare
@DrSensor DrSensor released this 09 Jul 05:58

πŸ“° See more on the Release Article

βœ” New shortcut syntax
βœ” New target transpilation
βœ” Integrate with others CLI

quick_demo

Changes:

New Supported Format

πŸ—Ή State Machine Cat

New Syntax

This new syntax symbols will desugar into several expressions. For best experience, use fmonospaced font with programming ligatures like FiraCode

πŸ—Ή Toggle Transition

A <-> B @ Toggle

πŸ‘† will desugar into πŸ‘‡

A -> B @ Toggle
A <- B @ Toggle

release

πŸ—Ή Loop Transition

A ->> B @ Loop
// or
B <<- A @ Loop

πŸ‘† will desugar into πŸ‘‡

A -> B @ Loop
B -> B @ Loop

release

πŸ—Ή Transient Loop Transition

A >-> B @ Loop
// or
B <-< A @ Loop

πŸ‘† will desugar into πŸ‘‡

A -> B
B -> B @ Loop

release

πŸ—Ή Self Transition

Not exactly desugar into multiple expressions but this new syntax can give a clear distinction between normal transition and self transition.

->> B @ Loop

πŸ‘† is same as πŸ‘‡

B -> B @ Loop
// or
B <- B @ Loop

release

CLI (see usage)

Breaking changes

πŸ—Ή In subcommand code, positional argument [DIST] changes to -o, --output (cause by a bug in [clap][], probably πŸ€”)
πŸ—Ή In subcommand code and repl, flag --format <target> must be specified (to avoid favoritism)

New Features

πŸ—Ή Add print command in non-interactive mode (repl with no --interactive flag set)
πŸ—Ή Add exit command to close REPL session
πŸ—Ή Tweak error prompt color
πŸ—Ή In subcommand code, use special error handle when positional argument <FILE> is a directory
πŸ—Ή Semantic check depend on the output format. For example. --as png will disable semantic check and instead mark and note the illegal transition.
πŸ—Ή Hide empty result when repl -i piped from stdin (it will not print empty line or comment)
πŸ—Ή --output <DIST> will give an error messages that it must be specified if outputting --as <format> binary file (e.g --as jpg)
πŸ—Ή --as <format> will give an error messages if paired with wrong --format <target> (e.g --format smcat --as boxart)
πŸ—Ή possible values in --as <format> will be hidden and disabled if certain others CLI not being installed

πŸ—Ή Hook to others CLI

In this update, scrap able to support others formats only if this CLI has been installed:

This brings several ability if combined with certain tools, for example:

Live preview the visual representation in terminal window

live preview boxart.gif

Live preview the visual representation in the VSCode (output must be png, jpg, or similar)

live preview png.gif

Live preview the visual representation as SVG format in the web browser

live preview svg.gif