Skip to content

Commit

Permalink
fix grammar around 'consist'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkBst authored and Veykril committed Jun 21, 2022
1 parent d102afb commit bfa419d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decl-macros/patterns/internal-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ macro_rules! foo {

This is definitely not the nicest solution we could have for this macro, as it pollutes the global macro namespace as mentioned earlier.
In this specific case `as_expr` is also a very simple macro that we only used once, so let's "embed" this macro in our `foo` macro with internal rules!
To do so we simply prepend a new matcher for our macro consists of the matcher used in the `as_expr` macro, but with a small addition.
To do so, we simply prepend a new matcher for our macro, which consists of the matcher used in the `as_expr` macro, but with a small addition.
We prepend a tokentree that makes it match only when specifically asked to.
In this case we can for example use `@as_expr`, so our matcher becomes `(@as_expr $e:expr) => {$e};`.
With this we get the macro that was defined at the very top of this page:
Expand Down

0 comments on commit bfa419d

Please sign in to comment.