Handling both #[x] and #[x("y")]

I have a procedural macro that I would like to work
with and without an argument, like this:

#[x]
and
#[x("y")]

Is there some way to handle both cases so as to avoid
error: unexpected end of input, expected expression
when I use the argument-less version?

is_empty!

3 Likes