diff options
| author | Mark Mansi <markm@cs.wisc.edu> | 2018-01-26 17:26:09 -0600 |
|---|---|---|
| committer | Mark Mansi <markm@cs.wisc.edu> | 2018-01-30 12:42:51 -0600 |
| commit | 6943430e6d0ff11db4d99544cef7d480b15385e5 (patch) | |
| tree | 86b5a24493882506921242ac71a08834a6b66d97 | |
| parent | bd98a935587ad988b5780b75021b1a45d0f508d7 (diff) | |
| download | rust-6943430e6d0ff11db4d99544cef7d480b15385e5.tar.gz rust-6943430e6d0ff11db4d99544cef7d480b15385e5.zip | |
Add ? to unstable book
| -rw-r--r-- | src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md b/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md new file mode 100644 index 00000000000..dbaf91b6e78 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md @@ -0,0 +1,17 @@ +# `macro_at_most_once_rep` + +The tracking issue for this feature is: TODO(mark-i-m) + +With this feature gate enabled, one can use `?` as a Kleene operator meaning "0 +or 1 repetitions" in a macro definition. Previously only `+` and `*` were allowed. + +For example: +```rust +macro_rules! foo { + (something $(,)?) // `?` indicates `,` is "optional"... + => {} +} +``` + +------------------------ + |
