pub fn expect_create_table<'t>(tokens: &'t [Token]) -> ExpectResult<'t, CreateTableStatement> {
    let (if_not_exists, rest, tokens_consumed_count_if_not_exists) =
        match expect_token_values_sequence(
            tokens,
            &[
                TokenValue::Const(Keyword::If),
                TokenValue::Const(Keyword::Not),
                TokenValue::Const(Keyword::Exists),
            ],
        ) {
            Ok(ExpectOk {
                rest,
                tokens_consumed_count,
                ..
            }) => (true, rest, tokens_consumed_count),
            Err(_) => (false, tokens, 0),
        };
    let ExpectOk {
        outcome: table,
        rest,
        tokens_consumed_count: tokens_consumed_count_table_definition,
    } = expect_table_definition(rest)?;
    Ok(ExpectOk {
        rest,
        tokens_consumed_count: tokens_consumed_count_table_definition
            + tokens_consumed_count_if_not_exists,
        outcome: CreateTableStatement {
            table,
            if_not_exists,
        },
    })
}
/// Conjure a CreateTableStatement from tokens following CREATE TABLE.
Conjure a CreateTableStatement from tokens following CREATE TABLE.
Conjure a CreateTableStatement from tokens following CREATE TABLE .
pub fn expect_create_table<'t>(tokens: &'t [Token]) -> ExpectResult<'t, CreateTableStatement> {
    let (if_not_exists, rest, tokens_consumed_count_if_not_exists) =
        match expect_token_values_sequence(
            tokens,
            &[
                TokenValue::Const(Keyword::If),
                TokenValue::Const(Keyword::Not),
                TokenValue::Const(Keyword::Exists),
            ],
        ) {
            Ok(ExpectOk {
                rest,
                tokens_consumed_count,
                ..
            }) => (true, rest, tokens_consumed_count),
            Err(_) => (false, tokens, 0),
        };
    let ExpectOk {
        outcome: table,
        rest,
        tokens_consumed_count: tokens_consumed_count_table_definition,
    } = expect_table_definition(rest)?;
    Ok(ExpectOk {
        rest,
        tokens_consumed_count: tokens_consumed_count_table_definition
            + tokens_consumed_count_if_not_exists,
        outcome: CreateTableStatement {
            table,
            if_not_exists,
        },
    })
}
pub fn expect_create_table < ' t > ( tokens : & ' t [ Token ] ) -> ExpectResult < ' t , CreateTableStatement > { let ( if_not_exists , rest , tokens_consumed_count_if_not_exists ) = match expect_token_values_sequence ( tokens , & [ TokenValue :: Const ( Keyword :: If ) , TokenValue :: Const ( Keyword :: Not ) , TokenValue :: Const ( Keyword :: Exists ) , ] , ) { Ok ( ExpectOk { rest , tokens_consumed_count , .. } ) => ( true , rest , tokens_consumed_count ) , Err ( _ ) => ( false , tokens , 0 ) , } ; let ExpectOk { outcome : table , rest , tokens_consumed_count : tokens_consumed_count_table_definition , } = expect_table_definition ( rest ) ? ; Ok ( ExpectOk { rest , tokens_consumed_count : tokens_consumed_count_table_definition + tokens_consumed_count_if_not_exists , outcome : CreateTableStatement { table , if_not_exists , } , } ) }
Conjure a CreateTableStatement from tokens following CREATE TABLE.
Conjure a CreateTableStatement from tokens following CREATE TABLE .
tokens
&'t [Token]