Module trigger

Module trigger 

Source
Expand description

Validate triggers, which are parts of the script that specify yes or no conditions.

Structs§

PartFlags

Enums§

Part
A part in a token chain
Trigger
A description of the constraints on the right-hand side of a given trigger. In other words, how it can be used.

Functions§

is_character_token
match_trigger_bv 🔒
Takes a Trigger and a trigger field, and validates that the constraints specified by the Trigger hold.
match_trigger_fields 🔒
Implementation of the Trigger::Block variant and its friends. It takes a list of known fields and their own Trigger validators, and checks that the given block contains only fields from that list and validates them.
partition
This function partitions the input token into parts separated by .. Each part may contain either a token or a token-argument pair when using the ()-syntax, e.g. "prowess_diff(liege)". It does not validate the tokens or arguments, but simply parses and detects any syntactical errors.
scope_trigger
Look up a trigger token that evaluates to a trigger value.
trigger_comparevalue
This function checks if the trigger is one that can be used at the end of a scope chain on the right-hand side of a comparator.
validate_argument
Validate that the argument passed through is valid, either being of a complex trigger compare value, or a scope prefix.
validate_argument_internal 🔒
validate_argument_scope
Validate for scope and not trigger arguments
validate_inscopes
validate_prefix
Validate a prefix:value construct in a trigger.
validate_target
Just like validate_target_ok_this, but warns if the target is a literal this because that is usually a mistake.
validate_target_ok_this
Validate that token is valid as the right-hand side of a field.
validate_trigger
The standard interface to trigger validation. Validates a trigger in the given ScopeContext.
validate_trigger_internal
The interface to trigger validation when validate_trigger is too limited.
validate_trigger_key_bv
Validate a trigger given its key and argument. It is like validate_trigger_internal except that all special cases are assumed to have been handled. This is the interface used for the switch effect, where the key and argument are not together in the script.
validate_trigger_max_sev
Like validate_trigger but specifies a maximum Severity for the reports emitted by this validation. Used to validate triggers in item definitions that don’t warrant the Error level.
validate_trigger_rhs
warn_not_first