Preview
Syntax
node <Id> "<Title>" "<Category>" <kind>
desc <text>
include <header>
color #hex
prop <name> "<Label>" = <default>
template T [: concept | {int|float}] [= default | = @prop]
in <name> : <type> [= default]
out <name> : <type> [= expr | = @prop]
cpp <C++ statement>
py <Python statement>
py out <name> [if T <concept>] = expr
py import <module>
js … / js out … / js import …
overload "<label>"
end
multi-line: cpp, py or js alone on a line, or an out … = with nothing after it, takes the more-indented lines below as one block:
cpp
if ({v} > 0)
std::puts("positive");
out r : T =
{a} * {a} +
{b} * {b}
kinds: pure (expression), exec (statement)
concepts: any, arithmetic, integral, floating_point, signed_integral, unsigned_integral, string, container, equality_comparable, totally_ordered, printable
exec outputs: with = expr they're declared after the code; without, they're declared before it so the code can assign {out} (Python code just assigns it; in JavaScript it is declared with let).
Python / JavaScript: {T} becomes that language's type (float, list[int] / number, number[], …). With several py out lines for one output, the first whose if T concept holds wins. A node without lines for the target language is reported, unless its snippet is just a placeholder like {text}.
Copy a built-in