From 7c384312e639a95ac118341bb389494219a181b7 Mon Sep 17 00:00:00 2001 From: tajmone Date: Tue, 10 May 2022 13:32:39 +0200 Subject: [PATCH] Helper Contexts Add a few custom "helpers contexts" (unused yet) which are handy to have around to improve syntax readability: * `force-pop` * `pop-at-EOL` * `consume-whitespace` * `consume-EOL` --- Syntaxes/Asciidoctor.sublime-syntax | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Syntaxes/Asciidoctor.sublime-syntax b/Syntaxes/Asciidoctor.sublime-syntax index 676daef..e6b4224 100644 --- a/Syntaxes/Asciidoctor.sublime-syntax +++ b/Syntaxes/Asciidoctor.sublime-syntax @@ -34,6 +34,29 @@ contexts: - include: inline - include: characters +#******************************************************************************* +# * +# H E L P E R S * +# * +#******************************************************************************* + +# Currently used in this syntax, but useful to have around in order to improve +# source readability. + + force-pop: + - match: '(?=\S)' + pop: true + + pop-at-EOL: + - match: '(?=[\n$])' + pop: true + + consume-whitespace: + - match: '[ \t]+' + + consume-EOL: + - match: '[\n$]' + #******************************************************************************* # * # B L O C K E L E M E N T S *