AjErl.Compiler.Parser.ParseToken C# (CSharp) Method

ParseToken() private method

private ParseToken ( TokenType type, string value ) : void
type TokenType
value string
return void
        private void ParseToken(TokenType type, string value)
        {
            Token token = this.NextToken();

            if (token == null)
                throw new ParserException(string.Format("Expected '{0}'", value));

            if (token.Type != type || token.Value != value)
                throw new ParserException(string.Format("Unexpected '{0}'", token.Value));
        }