diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-07-06 13:51:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-06 13:51:28 +0200 |
| commit | 07553cbe71cab60d1a29b72dc2ffbf25f0f3619c (patch) | |
| tree | bd049508b211ee61a3f636b5d1c2cb72153f318d /assets | |
| parent | 076ef3d5f25bdb48f4f33d5bb20b3cc2b64e11a1 (diff) | |
Raw syntax definition loading (#1655)
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/files/SExpressions.sublime-syntax | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/assets/files/SExpressions.sublime-syntax b/assets/files/SExpressions.sublime-syntax new file mode 100644 index 00000000..a18dd913 --- /dev/null +++ b/assets/files/SExpressions.sublime-syntax @@ -0,0 +1,73 @@ +%YAML 1.2 +--- +name: S Expressions +file_extensions: ["sexp"] +scope: source.sexpr + +contexts: + main: + - match: '(;+).*$' + scope: comment.line.sexpr + captures: + 1: punctuation.definition.comment.sexpr + - match: '#;' + scope: punctuation.definition.comment.sexpr + push: comment + - match: '#\|' + scope: punctuation.definition.comment.sexpr + push: block_comment + + - match: '"' + scope: punctuation.definition.string.begin.sexpr + push: string_unquote + - match: '\d+\.\d+' + scope: constant.numeric.float.sexpr + - match: '\d+' + scope: constant.numeric.integer.sexpr + - match: '\w+' + scope: constant.other.sexpr + - match: '\(' + scope: punctuation.section.parens.begin.sexpr + push: main_rparen + - match: '\)' + scope: invalid.illegal.stray-paren-end + + string_unquote: + - meta_scope: string.quoted.double.sexpr + - match: '""' + scope: constant.character.escape.sexpr + - match: '"' + scope: punctuation.definition.string.end.sexpr + pop: true + + main_rparen: + - match: '\)' + scope: punctuation.section.parens.end.sexpr + pop: true + - include: main + + comment: + - meta_scope: comment.block.sexpr + - match: '\(' + set: comment_rparen + + comment_lparen: + - meta_scope: comment.block.sexpr + - match: '\(' + push: comment_rparen + - match: '\)' + scope: invalid.illegal.stray-paren-end + + comment_rparen: + - meta_scope: comment.block.sexpr + - match: '\)' + pop: true + - include: comment + + block_comment: + - meta_scope: comment.block.sexpr + - match: '#\|' + push: block_comment + - match: '\|#' + scope: punctuation.definition.comment.sexpr + pop: true
\ No newline at end of file |
