Closed desaikd closed 1 year ago
As per an offline discussion, moving all the information to Transition
instead of State
resolves the weirdness around entry/exit condition checks on states instead having those checks to see if we can take a given transition or not.
List of change:
Transition
instead of states.State
as all states are now intermediate states which
removes complexity invoved with types of statesState
to Transition
usize
which its represents states idQQ: Should we still keep the Initial and Final state? or at least an initial state? (I have added a transition to itself for the initial state in order to start the validation process from initial state. Another option would be to perform an initial transition for state_id = 0 and visits = 0 explicitly).
QQ: Should we add a transition that skips optional states while building NFA? (If we have an initial state then we can remove the recursive calls for optional states to get all possible transitions. And simply add a transition that skips all optional states in the build process) - reference discussion https://github.com/amazon-ion/ion-schema-rust/pull/149#discussion_r1119360000
Issue #56:
Description of changes:
This PR works on adding an NFA state machine for validating
ordered_elements
constraint.List of changes:
ordered_elements
NfaBuilder
and usesNfaRun
to validatesordered_elements
constraintRange
ordered_elements
constraint (non greedy)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.