We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AllowNoSemi
Stmt::requires_terminator
Block::parse_within
I want to write a macro that adds a special type of statement. Currently I need to re-implement the sym functionality.
It would make much easier if AllowNoSemi was exposed or Block::parse_within allowed custom function to be passed:
struct My { Stmt(Stmt), Custom(Custom), } impl RequiresTerminator { fn requires_terminator(&self) -> bool { match self { My::Stmt(stmt) => stmt.requires_terminator(&self), My::Custom(my) => my.requires_terminator(&self), } } } let r: Vec<My> = Block::call_within(input, |input| { if input.peek(kw::my) { My::Custom(input.parse()?) } else { My::Stmt(input.parse()?) } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to write a macro that adds a special type of statement. Currently I need to re-implement the sym functionality.
It would make much easier if
AllowNoSemi
was exposed orBlock::parse_within
allowed custom function to be passed:The text was updated successfully, but these errors were encountered: