Skip to main content

Module eval

Module eval 

Source
Expand description

Evaluator: walks the crate::ast and produces a placed-primitive Drawing using pic’s positioning semantics.

Model (Kernighan §3): a pen with a current position and current direction walks the plane dropping primitives. Closed objects (box/circle/ ellipse/block) attach at the current point and advance by their extent; open objects (line/arrow/move/spline/arc) trace from the current point in the current direction. Labels, compass corners and ordinals (last/nth) resolve against previously placed objects.

Approximations (documented; refined later): arc renders a default quarter turn.

Structs§

EvalError
An evaluation error. info carries the structured diagnostic when the failure site had one at hand (a deferred-parse error’s full Diagnostic, or a place reference’s span); bindings surface it without re-deriving positions from the message.
EvalLimits

Constants§

DEFAULT_MAX_ANIMATION_REPEAT
DEFAULT_MAX_ANIMATION_SECONDS
DEFAULT_MAX_LOOP_ITERATIONS
DEFAULT_MAX_SHAPES

Functions§

eval
Evaluate a parsed picture into a Drawing.
eval_with_limits
Evaluate a parsed picture with host-provided resource limits.