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
use syn::{
    parse::{Parse, ParseStream},
    punctuated::Punctuated,
    Meta, Result, Token,
};

pub struct AttributeList {
    variables: Vec<Meta>,
}

impl AttributeList {
    pub fn variables(&self) -> impl Iterator<Item = &Meta> {
        self.variables.iter()
    }
}

impl Parse for AttributeList {
    fn parse(input: ParseStream) -> Result<Self> {
        Ok(Self {
            variables: Punctuated::<Meta, Token![,]>::parse_terminated(input)?
                .into_iter()
                .collect(),
        })
    }
}