YAML Script is a YAML based scripting language.
To build:
cargo {build | release}
To run tests:
cargo test [-- --nocapture]
To run:
./target/<debug|release>/ys <file>
Example:
./target/debug/ys examples/hello.ys
script:
<steps>
steps:
- <step>
...
step:
<var> | <echo> | <if> | <while> | <each> | <break> | <exec> | <def> | <call> | <exit>
(<def>
and <call>
are not yet implemented.)
var:
<name>: <boolean> | <integer> | <float> | <string> | <list> | <map> | <expression>
(Variables are global. <list>
and <map>
are not yet implemented.)
echo:
- echo: <expression>
if:
- if: <condition>
[then: <steps>]
[else: <steps>]
while:
- while: <condition>
[do: <steps>]
each:
- each: <name>
[in: <expression>]
[do: <steps>]
break:
- break: <condition>
[message: <string>]
exec:
- exec: <expression>
[as: <name>]
def:
- def: <name>
do: <steps>
call:
- call: <name>
[with:
<name>: <expression>
...]
exit:
- exit: <expression => number>
condition:
<expression> where true = true | non-zero | non-empty
expression:
${<name>} | ${<math-expression>} | ${<boolean-expression>}
(Expressions are handled by https://crates.io/crates/eval.)