You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some utility using parse_or_exit for quick prototyping. after updating from 0.3.1 to 0.3.2, the macro fails to parse.
for example, the code and error message:
// error: invalid flags syntax, expected one of `optional`, `required`, `repeated`, got Some(Punct { ch: ':', spacing: Alone, span: #0 bytes(598..599) })let flags = parse_or_exit!{
required --name name:String};// this compiles, but the generated `Flags` type is empty:let flags = parse_or_exit!{
required --name
};
after some digging, I think it is due to all the Ident tokens (required, --name and name in the above example) are parsed and consumed as aliases by line 85:
I have some utility using
parse_or_exit
for quick prototyping. after updating from 0.3.1 to 0.3.2, the macro fails to parse.for example, the code and error message:
after some digging, I think it is due to all the
Ident
tokens (required
,--name
andname
in the above example) are parsed and consumed as aliases by line 85:xflags/crates/xflags-macros/src/parse.rs
Lines 77 to 85 in bc37dc0
I made a local patch to put the alias parsing under the
anon
conditional guard, and it seems to have fixed the issue, as least for my simple use case:The text was updated successfully, but these errors were encountered: