1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use syn::{
parse::{Parse, ParseStream},
Result, Token,
};
use crate::widgets::PropertyName;
impl Parse for PropertyName {
fn parse(input: ParseStream) -> Result<Self> {
Ok(if input.peek(Token![::]) || input.peek2(Token! [::]) {
PropertyName::Path(input.parse()?)
} else {
PropertyName::Ident(input.parse()?)
})
}
}