• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // define macro tag with additional context
2 
3 #[macro_export(local_inner_macros)]
4 #[doc(hidden)]
5 macro_rules! context_tag {
6     ($tag:expr) => {
7         context(
8             $tag,
9             delimited(space_or_comments, tag($tag), space_or_comments),
10         )
11     };
12 }
13 // define macro ending delimiter with optional comma
14 #[macro_export(local_inner_macros)]
15 #[doc(hidden)]
16 macro_rules! end_delimiter {
17     ($tag:expr) => {
18         tuple((
19             space_or_comments,
20             opt(char(',')),
21             space_or_comments,
22             cut(tag($tag)),
23             space_or_comments,
24         ))
25     };
26 }
27