Skip to main content

Module parsing

Module parsing 

Source
Expand description

Central parsing module for the Forge DSL.

Mirrors Java’s FileSection.parseToMap() + CardTraitBase accessor methods. All pipe-delimited parameter parsing and typed access goes through the Params wrapper — no code should use raw BTreeMap<String, String> for DSL parameters.

Re-exports§

pub use amount::AmountExpr;
pub use cost::CostToken;
pub use cost::CostTokenKind;

Modules§

amount
card_script
compare
Comparison utilities for Forge DSL expressions.
cost
Semantic names for Forge Cost$ token identifiers.
keys
Compile-time constants for all DSL parameter keys.

Structs§

CompiledSelector
Typed wrapper around parsed DSL parameters.
CompiledSelectorAlternative
CompiledSelectorPart
ParamDiagnostic
ParamEntry
Params
ParsedCardScript
ParsedParams
ParsedParamsReport
ScriptAbility
ScriptDiagnostic
ScriptField
ScriptLine
ScriptParamRecord
ScriptSVar
Selector
SelectorAlt
SemanticComparison
SemanticParam
SemanticSelector
SemanticSelectorAlternative
SemanticSelectorPart
SemanticTransform

Enums§

CardColorSelector
CardIdentitySelector
CardSelectorType
CardStateSelector
CardSupertypeSelector
CastOrigin
ContextPredicate
ControllerSelector
NumericSelectorProperty
ParamDiagnosticKind
RelationPredicate
ScriptAbilityRecord
ScriptDiagnosticKind
ScriptLineKind
ScriptSVarNumericExpression
ScriptSVarObjectRef
ScriptSVarValue
SelectorCompareOperator
SelectorNumericOperand
SelectorPredicate
SemanticAmount
SemanticComparisonOperator
SemanticParamValue
SemanticParamValueKind
SemanticProducedMana
SemanticProducedManaCombo
TargetRef

Functions§

cached_compiled_selector
enchant_type_matches_card
Check if a card type matches an “Enchant ” keyword value. Used by aura SBA to verify the enchant restriction is still met.
enchant_type_to_target_params
Build a minimal targeting params string from an Enchant keyword payload. Handles special cases like Creature.inZoneGraveyard used by Animate Dead.
enchant_type_to_valid_tgts
parse_classified_or_warn
Adapter: convert a parse result to Option, logging failures only when the raw input looks like it was intended to be the given kind.
parse_or_warn
parse_semantic_param_value
raw_get
raw_has_any
raw_has_key
split_param_list_value
strip_times_multiplier
Strip a /Times.N multiplier suffix from a filter string. Returns (filter_without_suffix, multiplier).