コード例 #1
0
        /// <summary>
        /// Consume a token from the start of the list, returning a result with the token and remainder.
        /// </summary>
        /// <returns></returns>
        public TokenListParserResult <TKind, Token <TKind> > ConsumeToken()
        {
            EnsureHasValue();

            if (IsAtEnd)
            {
                return(TokenListParserResult.Empty <TKind, Token <TKind> >(this));
            }

            var token = _tokens ![Position];
コード例 #2
0
        /// <summary>
        /// Consume a token from the start of the list, returning a result with the token and remainder.
        /// </summary>
        /// <returns></returns>
        public TokenListParserResult <TKind, Token <TKind> > ConsumeToken()
        {
            EnsureHasValue();

            if (IsAtEnd)
            {
                return(TokenListParserResult.Empty <TKind, Token <TKind> >(this));
            }

            var token = _tokens[Position];

            return(TokenListParserResult.Value(token, this, new TokenList <TKind>(_tokens, Position + 1)));
        }