diff --git a/macro/src/parse.rs b/macro/src/parse.rs index d484f5bd80..d250d4c581 100644 --- a/macro/src/parse.rs +++ b/macro/src/parse.rs @@ -3,7 +3,7 @@ use syn::{ bracketed, parse::{Parse, ParseStream}, punctuated::Punctuated, - Result, Token, + Lit, Result, Token, }; pub struct IdentifierList { @@ -56,3 +56,34 @@ impl Parse for DialectOperationSet { }) } } + +pub struct PassSet { + prefix: Lit, + identifiers: IdentifierList, +} + +impl PassSet { + pub const fn dialect(&self) -> &Ident { + &self.dialect + } + + pub fn identifiers(&self) -> &[Ident] { + self.identifiers.identifiers() + } +} + +impl Parse for PassSet { + fn parse(input: ParseStream) -> Result { + let dialect = Ident::parse(input)?; + ::parse(input)?; + + Ok(Self { + dialect, + identifiers: { + let content; + bracketed!(content in input); + content.parse::()? + }, + }) + } +}