diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-12-18 13:43:46 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-12-18 16:47:38 +0530 |
| commit | 158a1bdd7dac47356a0cc44dd52308c7145f4afe (patch) | |
| tree | fe8f841eef4c25946930e44a007ac1f8c02c4eb9 | |
| parent | 7eb7bc2e04ad0f5f8ade80ff480ef8d2957e59d0 (diff) | |
| parent | d91b256fe54b5ac2095c4417407497b0739c8b29 (diff) | |
| download | rust-158a1bdd7dac47356a0cc44dd52308c7145f4afe.tar.gz rust-158a1bdd7dac47356a0cc44dd52308c7145f4afe.zip | |
Rollup merge of #30406 - durka:patch-13, r=sanxiyn
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
| -rw-r--r-- | src/doc/book/macros.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/book/macros.md b/src/doc/book/macros.md index f7f27858cd2..e4a900a2b1a 100644 --- a/src/doc/book/macros.md +++ b/src/doc/book/macros.md @@ -485,10 +485,10 @@ These rules provide some flexibility for Rust’s syntax to evolve without breaking existing macros. The macro system does not deal with parse ambiguity at all. For example, the -grammar `$($t:ty)* $e:expr` will always fail to parse, because the parser would -be forced to choose between parsing `$t` and parsing `$e`. Changing the +grammar `$($i:ident)* $e:expr` will always fail to parse, because the parser would +be forced to choose between parsing `$i` and parsing `$e`. Changing the invocation syntax to put a distinctive token in front can solve the problem. In -this case, you can write `$(T $t:ty)* E $e:exp`. +this case, you can write `$(I $i:ident)* E $e:expr`. [item]: ../reference.html#items |
