Пример #1
0
Файл: Token.cs Проект: 3F/IeXod
        /// <summary>
        /// Constructor takes the token type and the string that
        /// represents the token.
        /// If the string may contain content that needs expansion, expandable is set.
        /// </summary>
        internal Token(TokenType type, string tokenString, bool expandable)
        {
            ErrorUtilities.VerifyThrow
            (
                type == TokenType.Property ||
                type == TokenType.String ||
                type == TokenType.Numeric ||
                type == TokenType.ItemList ||
                type == TokenType.ItemMetadata ||
                type == TokenType.Function,
                "Unexpected token type"
            );

            ErrorUtilities.VerifyThrowInternalNull(tokenString, "tokenString");

            _tokenType      = type;
            _tokenString    = tokenString;
            this.Expandable = expandable;
        }