pub enum PsValue {
Show 21 variants
Null,
Mark,
DictMark,
Bool(bool),
Int(i64),
Real(f64),
Name(NameId),
String {
entity: EntityId,
start: u32,
len: u32,
},
Array {
entity: EntityId,
start: u32,
len: u32,
},
PackedArray {
entity: EntityId,
start: u32,
len: u32,
},
Dict(EntityId),
Operator(OpCode),
File(EntityId),
Save(SaveLevel),
FontID(i32),
Gstate(u32),
Stopped,
Loop(EntityId),
HardReturn,
DictEnd(EntityId),
ExecArray {
entity: EntityId,
start: u32,
len: u32,
pos: u32,
},
}Expand description
The value payload of a PostScript object.
Variants§
Null
Mark
DictMark
Dict mark from << — distinguished from Mark so ] only matches [-marks.
Bool(bool)
Int(i64)
A PostScript integer.
64-bit, matching Ghostscript. PLRM Appendix B’s 32-bit range is stated
as a limit “typical of PostScript implementations from Adobe Systems”
running “on 32-bit machines”, which “do not necessarily apply to all
PostScript implementations” — not a conformance requirement. 32 bits
breaks the standard LCG idiom
(seed 1103515245 mul 12345 add 2147483648 mod) that PostScript
programs use for pseudo-randomness: the product overflows, promotes to
Real, and mod then raises typecheck. Widening the fallback is not
an option — the product needs 55 bits and f64 carries 53, so the
sequence would silently diverge from every other interpreter.
Costs nothing: Real(f64) already forces an 8-byte payload.
Real(f64)
Name(NameId)
String
Array
PackedArray
Dict(EntityId)
Operator(OpCode)
File(EntityId)
Save(SaveLevel)
FontID(i32)
Gstate(u32)
Gstate object (index into Context.gstate_store)
Stopped
Loop(EntityId)
HardReturn
DictEnd(EntityId)
Marker that conditionally pops the dict stack when reached (used by
resource operators to clean up after dispatching to PS-defined category
procedures). Carries the expected entity so we only pop if it’s still
on top — the PS procedure may have already called end.
ExecArray
Procedure cursor on the exec stack — tracks position within a procedure
being executed. The eval loop advances pos one element at a time.