From 21c26ba3c05a1c0d8941f3ae4690e06313f692e5 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 1 May 2021 14:43:11 -0700 Subject: [PATCH] [Rust] Add `pat_param` macro fragment specifier. --- Rust/Rust.sublime-syntax | 2 +- Rust/tests/syntax_test_macros.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Rust/Rust.sublime-syntax b/Rust/Rust.sublime-syntax index 6d7b38961fc..4a2b32526f4 100644 --- a/Rust/Rust.sublime-syntax +++ b/Rust/Rust.sublime-syntax @@ -956,7 +956,7 @@ contexts: pop: true - include: macro-matchers - - match: '(\$\s*{{identifier}})\s*(:)\s*(ident|path|expr|ty|pat|stmt|block|item|meta|tt|lifetime|vis|literal)' + - match: '(\$\s*{{identifier}})\s*(:)\s*(ident|path|expr|ty|pat_param|pat|stmt|block|item|meta|tt|lifetime|vis|literal)' captures: 1: variable.parameter.rust 2: punctuation.separator.rust diff --git a/Rust/tests/syntax_test_macros.rs b/Rust/tests/syntax_test_macros.rs index 4dca24355e6..5f9d539d48e 100644 --- a/Rust/tests/syntax_test_macros.rs +++ b/Rust/tests/syntax_test_macros.rs @@ -334,6 +334,9 @@ macro_rules! designators { $p:pat, // ^^ variable.parameter // ^^^ storage.type + $pp:pat_param, +// ^^^ variable.parameter +// ^^^^^^^^^ storage.type $e:expr, // ^^ variable.parameter // ^^^^ storage.type