scrml.dev v0.7.1
Reference › Errors

E-TIMER-NAME-INVALID

<onTimeout name=…> carries a name that is not a valid identifier.

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

What it means

A timer name must be a valid identifier: ASCII letters, digits and underscores, PascalCase or camelCase, and not starting with a digit. The constraint exists because the name is used as a key in generated code; whitespace, punctuation or a leading digit would not survive into a usable cancelTimer() target.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce E-TIMER-NAME-INVALID.

<program title="p">
    type Phase:enum = { Idle, Busy }
    <engine for=Phase initial=.Idle>
        <Idle rule=(.Busy)>
            <onTimeout name="1retry" after=1000ms to=.Busy/>
            idle
        </>
        <Busy rule=(.Idle)>busy</>
    </>
</>

How to fix

  1. Rename to a valid identifier. name="1retry" becomes name="retry1" — a digit is fine anywhere except first.
  2. Drop name= entirely. The timer becomes index-keyed and uncancellable. Correct when nothing needs to cancel it.

Related

Specification

Normative text: §51.0.M, §19.13, §34. Spec lives at compiler/SPEC.md .

← Reference