1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use super::IdentifierList;
use proc_macro2::Ident;
use syn::{
    bracketed,
    parse::{Parse, ParseStream},
    Result, Token,
};

pub struct DialectOperationSet {
    dialect: Ident,
    identifiers: IdentifierList,
}

impl DialectOperationSet {
    pub const fn dialect(&self) -> &Ident {
        &self.dialect
    }

    pub fn identifiers(&self) -> &[Ident] {
        self.identifiers.identifiers()
    }
}

impl Parse for DialectOperationSet {
    fn parse(input: ParseStream) -> Result<Self> {
        let dialect = Ident::parse(input)?;
        <Token![,]>::parse(input)?;

        Ok(Self {
            dialect,
            identifiers: {
                let content;
                bracketed!(content in input);
                content.parse::<IdentifierList>()?
            },
        })
    }
}