JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Function fslSemanticSpans

    • Collect color / state / shape-enum semantic spans from text. State spans cover transition endpoints, state-declaration subjects, group-list members (&G : [a b c]; — but not the group's own name, nor &/...& nested group references), and plain-label hook subjects (on enter x do 'act'; — but not &group subjects). Every state span's value is the parser's resolved name (unquoted, unescaped), while from/to cover the source spelling including any quotes.

      Parameters

      • text: string

      Returns SemanticSpan[]

      fslSemanticSpans('state s : { color: crimson; };')
      .find(s => s.kind === 'color')?.value; // => '#dc143cff'
      fslSemanticSpans('&G : [a b];\na -> b;')
      .filter(s => s.kind === 'state').length; // => 4 (two members + two endpoints)