Skip to content

Instantly share code, notes, and snippets.

@danielbodart
Last active December 21, 2016 21:43
Show Gist options
  • Select an option

  • Save danielbodart/5107a830b772ef1e872c7dbe8daf7c69 to your computer and use it in GitHub Desktop.

Select an option

Save danielbodart/5107a830b772ef1e872c7dbe8daf7c69 to your computer and use it in GitHub Desktop.
#[macro_export]
macro_rules! optional (
($i:expr, $submac:ident!( $($args:tt)* )) => (
{
opt!($i, complete!($i, $submac!($i, $($args)*)))
}
);
($i:expr, $f:expr) => (
optional!($i, call!($f));
);
);
error: expected ident, found i
--> src/parser.rs:23:26
|
23 | opt!($i, complete!($i, $submac!($i, $($args)*)))
| ^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment