From a4517ae42c6c0267f68668e7a33b3ebab305bfd0 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 5 Feb 2019 11:46:40 -0800 Subject: [PATCH] Syntax: Abort on invalid struct syntax. This helps with macros which use funky syntax. --- RustEnhanced.sublime-syntax | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RustEnhanced.sublime-syntax b/RustEnhanced.sublime-syntax index 53d229c2..e55942aa 100644 --- a/RustEnhanced.sublime-syntax +++ b/RustEnhanced.sublime-syntax @@ -611,6 +611,9 @@ contexts: - match: '\{' scope: punctuation.definition.block.begin.rust push: struct-classic-body + - match: '(?=\S)' + # Abort for an invalid match. + pop: true struct-classic-body: - meta_scope: meta.block.rust @@ -628,7 +631,9 @@ contexts: - match: ':' scope: punctuation.separator.rust - include: type-any-identifier - + - match: '(?=\S)' + # Abort for an invalid match. + pop: true union-identifier: - meta_scope: meta.union.rust