pub(super) fn process_action(
    state: &Rc<RefCell<State>>,
    action: Action,
) -> NRResult<ParsingResult> {
    match action.action_type() {
        ActionType::VerbItemSubject => handle_event(&mut *state.borrow_mut(), action),
        ActionType::VerbSubject => handle_verb_subject(&mut *state.borrow_mut(), action),
        ActionType::VerbItem => handle_verb_item(state, action),
        ActionType::Verb => handle_verb(state, action),
        ActionType::Movement => handle_movement(&mut *state.borrow_mut(), action.movement),
        ActionType::Invalid => Err(InvalidAction.into()),
    }
}
/// This is the function that decides what to do with the
/// input based on the action type.
This is the function that decides what to do with the
input based on the action type.
This is the function that decides what to do with the input based on the action type .
pub(super) fn process_action(
    state: &Rc<RefCell<State>>,
    action: Action,
) -> NRResult<ParsingResult> {
    match action.action_type() {
        ActionType::VerbItemSubject => handle_event(&mut *state.borrow_mut(), action),
        ActionType::VerbSubject => handle_verb_subject(&mut *state.borrow_mut(), action),
        ActionType::VerbItem => handle_verb_item(state, action),
        ActionType::Verb => handle_verb(state, action),
        ActionType::Movement => handle_movement(&mut *state.borrow_mut(), action.movement),
        ActionType::Invalid => Err(InvalidAction.into()),
    }
}
pub ( super ) fn process_action ( state : & Rc < RefCell < State > > , action : Action , ) -> NRResult < ParsingResult > { match action . action_type ( ) { ActionType :: VerbItemSubject => handle_event ( & mut * state . borrow_mut ( ) , action ) , ActionType :: VerbSubject => handle_verb_subject ( & mut * state . borrow_mut ( ) , action ) , ActionType :: VerbItem => handle_verb_item ( state , action ) , ActionType :: Verb => handle_verb ( state , action ) , ActionType :: Movement => handle_movement ( & mut * state . borrow_mut ( ) , action . movement ) , ActionType :: Invalid => Err ( InvalidAction . into ( ) ) , } }
This is the function that decides what to do with the
input based on the action type.
This is the function that decides what to do with the input based on the action type .
state
&Rc<RefCell<State>>
action
Action
state
&Rc<RefCell<State>>
action
Action