private IndexDefinition IndexDefinition()
{
var indexType = IndexType.None;
IList<IndexColumnName> columns = new List<IndexColumnName>(1);
if (lexer.Token() == MySqlToken.KwUsing)
{
lexer.NextToken();
var tp = MatchIdentifier("BTREE", "HASH");
indexType = tp == 0 ? IndexType.Btree : IndexType.Hash;
}
Match(MySqlToken.PuncLeftParen);
for (var i = 0; lexer.Token() != MySqlToken.PuncRightParen; ++i)
{
if (i > 0)
{
Match(MySqlToken.PuncComma);
}
var indexColumnName = IndexColumnName();
columns.Add(indexColumnName);
}
Match(MySqlToken.PuncRightParen);
var options = IndexOptions();
return new IndexDefinition(indexType, columns, options);
}