Ancestry.QueryProcessor.Parse.LexerToken.CheckType C# (CSharp) Method

CheckType() public method

Ensures that the current TokenType is of the given type.
Will raise a LexerException if it is not.
public CheckType ( TokenType token ) : void
token TokenType
return void
        public void CheckType(TokenType token)
        {
            if (Type == TokenType.Error)
                throw Error;
            if (Type != token)
                throw new LexerException(LexerException.Codes.TokenExpected, Enum.GetName(typeof(TokenType), token));
        }