1 // Tests that `?` is a Kleene op and not a macro separator in the 2015 edition.
9 // The Kleene op `?` does not admit a separator before it.
11 ($(a),?) => {}; //~ERROR the `?` macro repetition operator
14 macro_rules! barplus {
15 ($(a)?+) => {}; // ok. matches "a+" and "+"
18 macro_rules! barstar {
19 ($(a)?*) => {}; // ok. matches "a*" and "*"
25 foo!(a?); //~ ERROR no rules expected the token `?`
26 foo!(a?a); //~ ERROR no rules expected the token `?`
27 foo!(a?a?a); //~ ERROR no rules expected the token `?`
29 barplus!(); //~ERROR unexpected end of macro invocation
30 barplus!(a); //~ERROR unexpected end of macro invocation
31 barplus!(a?); //~ ERROR no rules expected the token `?`
32 barplus!(a?a); //~ ERROR no rules expected the token `?`
36 barstar!(); //~ERROR unexpected end of macro invocation
37 barstar!(a); //~ERROR unexpected end of macro invocation
38 barstar!(a?); //~ ERROR no rules expected the token `?`
39 barstar!(a?a); //~ ERROR no rules expected the token `?`