private LexerEmitAction GetEmitAction(Channel defaultChannel)
        {
            if (Commands.Contains(Command.More))
            {
                return(LexerEmitAction.More);
            }

            if (Commands.Contains(Command.Skip))
            {
                return(LexerEmitAction.Skip);
            }

            return(LexerEmitAction.Token(Channel ?? defaultChannel, TokenType, Commands.Contains(Command.FlagError)));
        }
        public LexerAction(
            int priority,
            LexerValueAction valueAction,
            IEnumerable<LexerModeAction> modeActions,
            LexerEmitAction emitAction,
            string code)
        {
            if(valueAction == null) throw new ArgumentNullException(nameof(valueAction));

            Priority = priority;
            ValueAction = valueAction;
            ModeActions = modeActions.ToList();
            EmitAction = emitAction;
            Code = code;
        }