Separate MatchState to MatchResult and MatchFlag and make them pair.