Skip to content

Commit 13b7dba

Browse files
committed
Parse trailing dot or question on braced macro invocation
1 parent 9122197 commit 13b7dba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/stmt.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ pub mod parsing {
158158
// expression statements.
159159
let ahead = input.fork();
160160
if let Ok(path) = ahead.call(Path::parse_mod_style) {
161-
if ahead.peek(Token![!]) && (ahead.peek2(token::Brace) || ahead.peek2(Ident)) {
161+
if ahead.peek(Token![!])
162+
&& (ahead.peek2(token::Brace)
163+
&& !(ahead.peek3(Token![.]) || ahead.peek3(Token![?]))
164+
|| ahead.peek2(Ident))
165+
{
162166
input.advance_to(&ahead);
163167
return stmt_mac(input, attrs, path);
164168
}

tests/repo/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ const REVISION: &str = "ac2d9fc509e36d1b32513744adf58c34bcc4f43c";
1212

1313
#[rustfmt::skip]
1414
static EXCLUDE: &[&str] = &[
15-
// TODO: dot after curly braced macro call: macro!{...}.field
16-
// https://github.com/dtolnay/syn/issues/1068
17-
"src/test/ui/parser/macro-braces-dot-question.rs",
18-
1915
// TODO: impl ~const T {}
2016
// https://github.com/dtolnay/syn/issues/1051
2117
"src/test/ui/rfc-2632-const-trait-impl/syntax.rs",

0 commit comments

Comments
 (0)