scrml.dev v0.7.1
Reference › Errors

E-HISTORY-NO-INNER-ENGINE

history on a state-child with no inner <engine>.

Error Compile-time SPEC §51.0.N (normative)

What it means

history is composite-only. It records the inner machine's variant on exit and restores it on re-entry — so it needs an inner machine to have a variant worth remembering. On a leaf state-child there is no inner state, so the attribute has nothing to record and is rejected rather than silently ignored.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce E-HISTORY-NO-INNER-ENGINE.

<program title="p">
    type Phase:enum = { Idle, Busy }
    <engine for=Phase initial=.Idle>
        <Idle rule=(.Busy) history>idle</>
        <Busy rule=(.Idle)>busy</>
    </>
</>

How to fix

  1. Add an inner <engine>. Making the state-child composite gives history something to restore.
  2. Remove history. If the state is genuinely a leaf, the attribute is not doing anything.

Related

Specification

Normative text: §51.0.N, §51.0.Q, §34. Spec lives at compiler/SPEC.md .

← Reference