From c1db6fc1f54e708a6ae494e8b7939d6f757d1ae7 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 13 Dec 2019 14:07:07 -0800 Subject: [PATCH] Syntax: Recover on bad enum syntax. --- RustEnhanced.sublime-syntax | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RustEnhanced.sublime-syntax b/RustEnhanced.sublime-syntax index 492ca050..90473c16 100644 --- a/RustEnhanced.sublime-syntax +++ b/RustEnhanced.sublime-syntax @@ -684,6 +684,9 @@ contexts: - match: '{{identifier}}' scope: entity.name.enum.rust set: enum-maybe-where + - match: '(?=\S)' + # Abort on invalid character. + pop: true enum-maybe-where: - meta_scope: meta.enum.rust @@ -693,6 +696,9 @@ contexts: - match: '\{' scope: punctuation.definition.block.begin.rust set: enum-body + - match: '(?=\S)' + # Abort on invalid character. + pop: true enum-body: - meta_scope: meta.enum.rust