pub enum Stmt {
Object {
label: Option<Label>,
object: Object,
},
Place {
label: Label,
pos: Position,
},
Assign(Vec<Assignment>),
Direction(Dir),
Group(Vec<Stmt>),
Animate(Animate),
Class {
target: Place,
class: StringExpr,
},
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<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(Animate)
rpic animation directive (extension; see Animate).
Class
rpic extension: class <place> "name" — append a CSS class to an
already-drawn object’s shape group (labels and ordinals both work).
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.