StoneCypher / fsl

Finite State Language specification
9 stars 1 forks source link

Start states with invalid states cause machine to begin in inconsistent state #1203

Closed StoneCypher closed 2 years ago

StoneCypher commented 2 years ago

Admittedly user error, but, still ... gulp

$ node
Welcome to Node.js v18.4.0.
Type ".help" for more information.

> const jssm = require('.');  const sm = jssm.sm;
undefined

> const y = sm`start_states: [a]; c->b;`;
undefined

> y.state();
'a'

> y.states();
[ 'c', 'b' ]

> y.has_state( y.state() );
false

State is demanded start state a, which is a state never declared to exist. Ugh.