Skip to main content

Module content

Module content 

Source
Expand description

Structured rule content in the versioned workshop-rs/rule-content-v1 format.

rule_content renders one Rule as the canonical call tree defined by RULE_CONTENT_V1_SCHEMA. Every value and action is a call node named by its catalog id; literals, strings, enum members, and declared variable or subroutine names use the tagged forms the schema defines. Output is deterministic for a given rule and independent of the source locale.

Constructs the canonical model specializes but the catalog does not name use the reserved ids declared in the schema: globalVariable and playerVariable for variable reads, assignMember and modifyMember for member-assignment actions, and a zero-argument operator call such as {"call":"add","args":[]} for the modify operand.

Constants§

ASSIGN_MEMBER_CALL
The reserved call id for a plain member assignment (target = value).
GLOBAL_VARIABLE_CALL
The reserved call id for a global variable read.
MEMBER_ACCESS_CALL
The reserved call id for a receiver member read (receiver.member or receiver.member[index]). It appears inside ASSIGN_MEMBER_CALL and MODIFY_MEMBER_CALL targets and anywhere a member read is a value.
MODIFY_MEMBER_CALL
The reserved call id for a compound member assignment (target op= value).
PLAYER_VARIABLE_CALL
The reserved call id for a player variable read.
RAW_WORKSHOP_ACTION_CALL
The reserved call id for an opaque action the parser preserved without canonical content (a raw Workshop residual). It carries no arguments.
RULE_CONTENT_V1
The format identity every produced document carries in "format".
RULE_CONTENT_V1_SCHEMA
The published JSON Schema for RULE_CONTENT_V1 documents.

Functions§

rule_content
Render one rule in the RULE_CONTENT_V1 format; see Rule::content.