about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md17
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"...
+        => {}
+}
+```
+
+------------------------
+