Check 5 (spec 3.10): a :history state's placement, default transition,
and type. Four independent facts, per :history state in the document:
{:history_bad_parent, id, parent_kind}when the parent is not a compound<state>or a<parallel>(Context.compound?/1, Decision- the document root, a
:final, and another:historyare all illegal parents.
- the document root, a
Statifier.Validator.Checks.DefaultTransition's shared sub-check withowner: {:history, id}- required, exactly one, a non-null target, noevent, nocond(spec 3.10 requires the default transition unconditionally, stricter than a looser "when present" reading).{:initial_not_descendant, target, parent_id}when a resolved default target is not a descendant of the history's own parent (spec 3.10)- not of the history state itself, which has no descendants of its
own to test against. Reuses check 3's constructor: this is the same
shape of mistake, just against a different parent. Skipped when the
target does not resolve at all (
Statifier.Validator.Checks.Targetsalready reported that) or when the parent is not compound - a non-compound parent has already been reported by:history_bad_parent, and testing descendancy against it (an id that may not even exist, for the document root) would be a second, meaningless error for the same mistake.
- not of the history state itself, which has no descendants of its
own to test against. Reuses check 3's constructor: this is the same
shape of mistake, just against a different parent. Skipped when the
target does not resolve at all (
{:history_bad_type, raw}whentypewas written and, sliced back out ofcontext.source, is neither"shallow"nor"deep". Lowering silently maps any out-of-range value to the:shallowdefault (Residual Note 2), so the atom on%State{}alone cannot telltype="shallow"fromtype="sideways"- only the raw source text can.
Summary
Functions
Returns, per :history state in the document, any combination of a
:history_bad_parent error (the parent is not a compound <state> or
<parallel>), the shared default-transition errors from
Statifier.Validator.Checks.DefaultTransition, an :initial_not_descendant
error (the default transition's target is not a descendant of the
history's own parent), and a :history_bad_type error (a written type
that is neither "shallow" nor "deep"). Returns [] when every
:history state's placement, default transition, and type are all legal.
Functions
@spec check( document :: Statifier.Document.t(), context :: Statifier.Validator.Context.t() ) :: [ Statifier.Validator.Error.t() ]
Returns, per :history state in the document, any combination of a
:history_bad_parent error (the parent is not a compound <state> or
<parallel>), the shared default-transition errors from
Statifier.Validator.Checks.DefaultTransition, an :initial_not_descendant
error (the default transition's target is not a descendant of the
history's own parent), and a :history_bad_type error (a written type
that is neither "shallow" nor "deep"). Returns [] when every
:history state's placement, default transition, and type are all legal.