pub enum Stmt {
Show 16 variants
Object {
label: Option<Label>,
object: Object,
},
Place {
label: Label,
pos: Position,
},
Assign(Vec<Assignment>),
Direction(Dir),
Group(Vec<Stmt>),
Animate(Box<Animate>),
AnimateScroll,
Draggable(Draggable),
Class {
target: Place,
class: StringExpr,
},
Link {
target: Place,
url: StringExpr,
},
Canvas {
from: Position,
to: Position,
},
If {
cond: Expr,
then_body: Body,
else_body: Option<Body>,
},
For {
var: String,
subscript: Option<Expr>,
from: Expr,
to: Expr,
by: Expr,
mult: bool,
body: Body,
},
Print(PrintItem),
Exec {
command: StringExpr,
arg_frame: Option<Arc<Vec<Vec<Spanned>>>>,
},
Reset(Vec<EnvVar>),
}Expand description
A top-level element.
Variants§
Object
A drawn object, optionally labelled (Start: box …).
Place
Label: position — names a point without drawing.
Assign(Vec<Assignment>)
One or more comma-separated assignments.
Direction(Dir)
A bare direction change (up / down / left / right).
Group(Vec<Stmt>)
{ … } grouping block (local scope, no bounding object).
Animate(Box<Animate>)
rpic animation directive (extension; see Animate).
AnimateScroll
rpic extension: animate scroll — a timeline-level hint that the host
should scrub the animation on scroll instead of autoplaying.
Draggable(Draggable)
rpic extension: draggable <place> [inertia] [bounds <place>] [x|y] —
mark an object grabbable in the browser (GSAP Draggable). Interaction,
not a timeline effect, so it is its own directive.
Class
rpic extension: class <place> "name" — append a CSS class to an
already-drawn object’s shape group (labels and ordinals both work).
Link
rpic extension: link <place> "<url>" — make an already-drawn object a
hyperlink (its SVG shape group is wrapped in <a href>).
Canvas
rpic extension: canvas from <pos> to <pos> — fix the output page to
the rectangle spanned by the two corners, independent of content, so
the viewBox stays stable while objects move (visual editors).
If
if <cond> then { … } [else { … }]. Bodies are deferred raw tokens.
For
for v = from to to [by [*] step] do { … }. Body is deferred raw tokens.
Fields
Print(PrintItem)
print … (evaluated for diagnostics; no drawing effect).
Exec
exec <string> — evaluate generated pic source in the current state.
Reset(Vec<EnvVar>)
reset (all) or reset a, b, … — restore environment variables.