Skip to content

Commit

Permalink
Helper Contexts
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
tajmone committed May 10, 2022
1 parent c15bf96 commit 7c38431
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Syntaxes/Asciidoctor.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 7c38431

Please sign in to comment.