pub fn validate_datatypes(
chain: &CodeChain,
data: &Everything,
sc: &mut ScopeContext,
dc: &DataContext,
expect_type: Datatype,
lang: Option<Language>,
format: Option<&Token>,
expect_promote: bool,
) -> DatatypeExpand description
Validate a datafunction chain, which is the stuff between [ ] in localization.
chainis the parsed datafunction structure.scis aScopeContextused to evaluate scope references in the datafunctions. If nothing is known about the scope, just pass an emptyScopeContextwithset_strict_types(false).expect_typeis the datatype that should be returned by this chain, can beDatatype::Unknownin many cases.langis set to a specific language ifCustomreferences in this chain only need to be defined for one language. It can just beNoneotherwise.formatis the formatting code given after|in the datatype expression. It’s used for checking that game concepts in ck3 have|Eformats.expect_promoteis true iff the chain is expected to end on a promote rather than on a function. Promotes and functions are very similar but they are defined separately in the datafunction tables and usually only a function can end a chain.